Skip to content

Commit 72dd8f3

Browse files
committed
Fixed cnrecs.def comments; enhanced documentation
2 parents 941c022 + ac1a349 commit 72dd8f3

File tree

2 files changed

+53
-17
lines changed

2 files changed

+53
-17
lines changed

doc/src/records/accumulator.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,51 @@
11
# ACCUMULATOR
22

3-
An ACCUMULATOR object is a user-defined "device" that records arbitrary values computed during the CSE simulation.
3+
An ACCUMULATOR is driven by arbitrary subhourly expression value computed during the CSE simulation and calculates minimum, maximum, mean, and sum values for hour, day, month, and year intervals. In addition, timestamps are retained for the minimum and maximum values. ACCUMULATORs are useful for summarizing and reporting values for which there is not built-in accounting (for example, ZNRES or RSYSRES). One common use case is for reporting hour average values of internal variables that vary subhourly.
44

5-
TODO: expand description and example
5+
ACCUMULATORs are "observing" devices -- they have no effect on the CSE building model or calculations. ACCUMULATOR values must be reported using user-defined REPORTs or EXPORTs.
66

7-
ACCUMULATOR results must be reported using user-defined REPORTs or EXPORTs. For example --
7+
As a simple example, a report of monthly outdoor drybulb temperatures can be generated as follows --
88

9-
REPORT rpType=UDT rpFreq=Month rpDayBeg=Jan 1 rpDayEnd=Dec 31
10-
REPORTCOL colHead="mon" colVal=$Month colWid=3
11-
REPORTCOL colHead=" Sum" colVal=@Accumulator[ 1].M.acmSum colDec=0 colWid=10
12-
REPORTCOL colHead="Average" colVal=@Accumulator[ 1].M.acmMean colDec=0 colWid=10
9+
ACCUMULATOR "ACTDB" acmValue=$tdbosh
10+
11+
REPORT "TODB" rpType=UDT rpFreq=Month rpTitle="Outdoor drybulb temp (F)"
12+
REPORTCOL colHead="Mon" colVal=$Month colWid=3
13+
REPORTCOL colHead="Min" colVal=@Accumulator[ "ACTDB"].M.acmMin colDec=2 colWid=6
14+
REPORTCOL colHead="Mean" colVal=@Accumulator[ "ACTDB"].M.acmMean colDec=2 colWid=6
15+
REPORTCOL colHead="Max" colVal=@Accumulator[ "ACTDB"].M.acmMax colDec=2 colWid=6
16+
REPORT rpType=UDT rpFreq=Year rpHeader=No
17+
REPORTCOL colVal="Yr" colWid=3
18+
REPORTCOL colVal=@Accumulator[ "ACTDB"].Y.acmMin colDec=2 colWid=6
19+
REPORTCOL colVal=@Accumulator[ "ACTDB"].Y.acmMean colDec=2 colWid=6
20+
REPORTCOL colVal=@Accumulator[ "ACTDB"].Y.acmMax colDec=2 colWid=6
21+
22+
Resulting output --
23+
24+
Outdoor drybulb temp (F)
25+
26+
Mon Min Mean Max
27+
--- ------ ------ ------
28+
1 28.22 46.87 60.08
29+
2 32.00 49.26 69.98
30+
3 42.08 60.79 91.40
31+
4 34.70 58.13 79.16
32+
5 44.42 67.07 97.88
33+
6 50.36 73.43 107.96
34+
7 55.04 74.02 101.48
35+
8 53.60 74.99 104.18
36+
9 48.92 69.24 97.52
37+
10 47.84 64.00 98.42
38+
11 32.54 54.47 77.00
39+
12 28.04 46.58 64.04
40+
41+
Yr 28.04 61.65 107.96
42+
43+
Generalizing what is illustrated, probing @accumulator[ ].H yields statistics for the current hour, .D for the current day, .M the current month, and .Y for the year (or, more precisely, the full run, which may or may not be a full year).
44+
45+
A complete list of the available statistics for each interval is found in the ACCUMULATOR probe documentation.
46+
47+
Note: The initial version of ACCUMULATOR contains unresolved bugs related to the timing of the determination of acmValue. In some cases, acmValue is set to the expression value from the prior substep. This is being investigated.
1348

14-
(Note use of colHead=" Sum" (not colHead="Sum") to avoid a CSE parsing quirk. See REPORTCOL.)
1549

1650
**acmName**
1751

@@ -26,7 +60,7 @@ Name of ACCUMULATOR: required for referencing in reports.
2660

2761
**acmValue=*float***
2862

29-
The value being accumulated. Generally expression.
63+
The value being accumulated. Generally expression with subhourly variability.
3064

3165
<%= member_table(
3266
units: "any",

src/CNRECS.DEF

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,9 +1320,11 @@ RECORD XSURF "xsurf sub" *SUBSTRUCT // for PRI, SFI, XSRAT.
13201320
*mh FRAC sco // window: SMSO: Solar Heat Gain Coef multiplier, shades Open
13211321
*mh FRAC scc // window: SMSC: Solar Heat Gain Coef, shades Closed
13221322
*r *nest SBC xs_sbcI // inside (zone side) surface boundary conditions
1323+
// ASHWAT windows: BCs at inside face of inside layer (glazing or shade; frame excluded, see xs_frmSbcI)
13231324
*r *nest SBC xs_sbcO // outside (ambient or adjacent zone) surface boundary conditions
1325+
// ASHWAT windows: BCs at outside face of outside layer (glazing, screen, or shade; frame excluded, see xs_frmSbcO)
13241326
*r *nest SBC xs_frmSbcI // ASHWAT windows: frame inside (zone side) surface boundary conditions
1325-
*r *nest SBC xs_frmSbcO // ASHWAT windows: frame outside (ambient (or adjacent zone?)) surface boundary conditions
1327+
*r *nest SBC xs_frmSbcO // ASHWAT windows: frame outside (ambient) surface boundary conditions
13261328

13271329
*i FENMODELCH xs_fenModel // fenestration model: user input
13281330
*i FRAC xs_SHGC // rated SHGC of assembly
@@ -5564,18 +5566,18 @@ DBL acmSum // sum of values in interval
55645566
SI acmMinDayOfYear // day of year on which min occurs, 1-365
55655567
SI acmMinDayOfYearST // day of year (standard time) on which min occurs, 1-365
55665568
// can differ from acmMinDayOfYear iff Top.DT=Yes
5567-
SI acmMinHour // hour of day at which min occurs, 1-24
5568-
SI acmMinHourST // hour of day (standard time) at which min occurs, 1-24
5569+
SI acmMinHour // hour of day at which min occurs, 0-23
5570+
SI acmMinHourST // hour of day (standard time) at which min occurs, 0-23
55695571
// can differ from acmMinHour iff Top.DT=Yes
5570-
SI acmMinSubhour // subhour within hour at which min occurs, 1-Top.tp_nSubSteps
5572+
SI acmMinSubhour // subhour within hour at which min occurs, 0 - Top.tp_nSubSteps-1
55715573

55725574
SI acmMaxDayOfYear // day of year on which min occurs, 1-365
5573-
SI acmMaxDayOfYearST // day of year (standard time) on which max occurs, 1-365
5575+
SI acmMaxDayOfYearST // day of year (standard time) on which max occurs, 0-23
55745576
// can differ from acmMaxDayOfYear iff Top.DT=Yes
5575-
SI acmMaxHour // hour of day at which min occurs, 1-24
5576-
SI acmMaxHourST // hour of day (standard time) at which max occurs, 1-24
5577+
SI acmMaxHour // hour of day at which min occurs, 0-23
5578+
SI acmMaxHourST // hour of day (standard time) at which max occurs, 0-23
55775579
// can differ from acmMaxHour iff Top.DT=Yes
5578-
SI acmMaxSubhour // subhour within hour at which min occurs, 1-Top.tp_nSubSteps
5580+
SI acmMaxSubhour // subhour within hour at which min occurs, 0 - Top.tp_nSubSteps-1
55795581

55805582
*END // ACCUMULATOR_IVL
55815583
//=============================================================================

0 commit comments

Comments
 (0)