Skip to content

Commit 5a004c2

Browse files
authored
Merge pull request #570 from cse-sim/transmitted-solar
Window solar gain accounting / ACCUMULATOR improvements
2 parents bbe7d46 + 9a0afff commit 5a004c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+7024
-520770
lines changed

doc/src/cse-user-manual.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ sections:
6666
- [2, "records/dhwmeter.md"]
6767
- [2, "records/afmeter.md"]
6868
- [2, "records/loadmeter.md"]
69+
- [2, "records/accumulator.md"]
6970
- [2, "records/zone.md"]
7071
- [2, "records/gain.md"]
7172
- [2, "records/surface.md"]

doc/src/records/accumulator.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# ACCUMULATOR
2+
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.
4+
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.
6+
7+
As a simple example, a report of monthly outdoor drybulb temperatures can be generated as follows --
8+
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.
48+
49+
50+
**acmName**
51+
52+
Name of ACCUMULATOR: required for referencing in reports.
53+
54+
<%= member_table(
55+
units: "",
56+
legal_range: "*63 characters*",
57+
default: "*none*",
58+
required: "Yes",
59+
variability: "constant") %>
60+
61+
**acmValue=*float***
62+
63+
The value being accumulated. Generally expression with subhourly variability.
64+
65+
<%= member_table(
66+
units: "any",
67+
legal_range: "",
68+
default: "",
69+
required: "Yes",
70+
variability: "subhourly") %>
71+
72+
73+
**endACCUMULATOR**
74+
75+
Indicates the end of the ACCUMULATOR definition. Alternatively, the end of the definition can be indicated by the declaration of another object or by END.
76+
77+
<%= member_table(
78+
units: "",
79+
legal_range: "",
80+
default: "*none*",
81+
required: "No",
82+
variability: "constant") %>
83+
84+
**Related Probes:**
85+
86+
- @[accumulator](#p_accumulator)

doc/src/records/door.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ Interior convection coefficient adjustment factor. When drInHcModel=INPUT, hc=d
254254

255255
**drInHcFrcCoeffs=*float array***
256256

257-
Specifies 3 coefficients for an alternative inside surface forced convection model (applicable only for drInHCModel=UNIFIED). When given, the inside surface forced convection coefficient for this surface is derived as follows:
257+
Specifies 3 coefficients for an alternative inside surface forced convection model (applicable only for drInHcModel=UNIFIED). When given, the inside surface forced convection coefficient for this surface is derived as follows:
258258

259259
hcFrc = hConvF * (drInHcFrcCoeffs[ 1] + drInHcFrcCoeffs[ 2] * ACH ^ drInHcFrcCoeffs[ 3])
260260

doc/src/records/exportcol.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Value to show in this position in each row of export.
4646

4747
Text used for field name in export header.
4848

49+
Note: Due to quirk (or bug?) in CSE parsing, setting *colHead* equal to "sum", "all", or "all_but" (case-insensitive) will trigger an error message along the lines of "'SUM' cannot be used here." Adding a space avoids this issue. For example, colHead = " Sum" is accepted.
50+
4951
<%= member_table(
5052
units: "",
5153
legal_range: "",

doc/src/records/reportcol.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Value to show in this column of report.
4141

4242
Text used for column head.
4343

44+
Note: Due to quirk (or bug?) in CSE parsing, setting *colHead* equal to "sum", "all", or "all_but" (case-insensitive) will trigger an error message along the lines of "'SUM' cannot be used here." Adding a space avoids this issue. For example, colHead = " Sum" is accepted.
45+
4446
<%= member_table(
4547
units: "",
4648
legal_range: "",

src/CNRECS.DEF

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,11 +1269,11 @@ RECORD XSURF "xsurf sub" *SUBSTRUCT // for PRI, SFI, XSRAT.
12691269
*declare "XSURF& Copy( const XSURF* pXS, int options=0);"
12701270
*declare "RC xs_Validate( int options=0);"
12711271
*declare "SBC& xs_SBC( int si) { return si ? xs_sbcO : xs_sbcI; }"
1272+
*declare "SBC& xs_FrmSBC( int si) { return si ? xs_frmSbcO : xs_frmSbcI; }"
12721273
*declare "const char* xs_Name() const;"
12731274
*declare "int xs_CanHaveExtSlr() const;"
12741275
*declare "RC xs_SetUNom();"
12751276
*declare "float& xs_AbsSlr( int io) { return xs_SBC( io).sb_absSlr; }"
1276-
*declare "float xs_AreaGlazed() const;"
12771277
*declare "void xs_SetRunConstants();"
12781278
*declare "void xs_AccumZoneValues();"
12791279
*declare "void xs_sbTest();"
@@ -1298,7 +1298,9 @@ RECORD XSURF "xsurf sub" *SUBSTRUCT // for PRI, SFI, XSRAT.
12981298
*z SI xs_ty // type CTEXTWALL, CTINTWALL, CTWINDOW, CTMXWALL, CTPERIM, CTKIVA set by cult or code.
12991299

13001300
// inputs. *r's where set by topCkf in at least some cases.
1301-
*r AREA_GZ xs_area // (net) area, sf. Reflects window multiplier.
1301+
*r AREA_GZ xs_area // (net) area, ft2. Reflects window multiplier.
1302+
*r AREA_GZ xs_areaGlz // glazed area, ft2. nz iff window
1303+
// reflects window multiplier and frame fraction
13021304
*r ANGLE azm // azimuth (radians, 0 = North, Pi/2 = East)
13031305
*r ANGLE tilt // tilt (radians, 0 = horiz up, Pi/2 = vert.
13041306
*r *array 3 FLOAT xs_dircos // outward normal direction cosines for given azm/tilt
@@ -1318,7 +1320,11 @@ RECORD XSURF "xsurf sub" *SUBSTRUCT // for PRI, SFI, XSRAT.
13181320
*mh FRAC sco // window: SMSO: Solar Heat Gain Coef multiplier, shades Open
13191321
*mh FRAC scc // window: SMSC: Solar Heat Gain Coef, shades Closed
13201322
*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)
13211324
*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)
1326+
*r *nest SBC xs_frmSbcI // ASHWAT windows: frame inside (zone side) surface boundary conditions
1327+
*r *nest SBC xs_frmSbcO // ASHWAT windows: frame outside (ambient) surface boundary conditions
13221328

13231329
*i FENMODELCH xs_fenModel // fenestration model: user input
13241330
*i FRAC xs_SHGC // rated SHGC of assembly
@@ -1363,16 +1369,22 @@ RECORD XSURF "xsurf sub" *SUBSTRUCT // for PRI, SFI, XSRAT.
13631369

13641370
*r TI iwshad // 0 if none or subscr in WSHADRAT of overhang/fin info for a shaded window
13651371
*r TI xs_msi // 0, or mass (MsR) subscript for CTMXWALL.
1366-
*array XSMXTLRB *h *e
1367-
FLOAT xs_tLrB // layer boundary temps re probes
1368-
// populated at end of hour
1369-
1370-
// solar gain distributions: [partly] based on SGDIST inputs
1372+
1373+
// solar gain distributions: [partly] based on SGDIST inputs
13711374
*r SI nsgdist // Number of SG distributions
13721375
// SGDIST sgdist[ HSMXSGDIST]:
13731376
*array HSMXSGDIST // =8 (2-95), cndefns.h. explicit solar gain distribs
13741377
*r // min variation here: no members set at input time
13751378
*nest SGDIST sgdist // solar gain distribution (struct just above). set: cncult3.cpp:cnuSgDist().
1379+
1380+
// runtime values
1381+
*s *e FLOAT xs_glzTrans // ASHWAT windows: transmitted solar gain, Btuh/ft2 (w/o cavity absorp adjustment)
1382+
*s *e FLOAT xs_glzInward // ASHWAT windows: inward flowing convective and LW radiant gain to zone, Btuh/ft2
1383+
1384+
*array XSMXTLRB *h *e
1385+
FLOAT xs_tLrB // layer boundary temps re probes
1386+
// populated at end of hour
1387+
13761388
*END // XSURF
13771389
//=============================================================================
13781390
RECORD PRI "perimeter" *RAT // perimeter input RAT
@@ -1441,7 +1453,7 @@ RECORD SFI "surface" *RAT // opaque surface / door / window input info RAT
14411453
//window only
14421454
*i LEN_GZ sf_width // width and height: used to compute shading,
14431455
*i LEN_GZ sf_height // ... and to compute area b4 mutliplier.
1444-
*i FLOAT_GZ mult // area multiplier (for multiple identical windows)
1456+
*i FLOAT_GZ sf_mult // area multiplier (for multiple identical windows)
14451457
//derived/internal
14461458
*r TI xi // subscript in runtime XSRAT, to facilitate access by probers 1-92
14471459
*r TI sf_msi // 0 or MSRAT MsR subscr which will be used if delayed model
@@ -2453,7 +2465,8 @@ RECORD ZNR "zone" *RAT // zone runtime info RAT. Set mainly from separate ZNI
24532465
*r DBL zn_BGWallPA5 // sum (perim*a5)
24542466

24552467
// ZNR loads runtime: hourly q's for Tz = (a + q)/b.
2456-
*h *e DBL qSgTot // hour total solar gain to some
2468+
*h *e FLOAT qSgTot // hour total solar gain to zone, Btuh
2469+
// = zn_sgTotTarg.st_tot
24572470
*h *e *nest SGTARG zn_sgTotTarg // hourly part of s g total (Btuh) for zone: hourly mass insides.
24582471
// Added to in cnloads.cpp:loadsHour via pointers in SgR entries made monthly
24592472
// in cgsolar.cpp per info in XSURFs made in cncultn.cpp. Used: cnztu.cpp re results qSlr
@@ -2498,10 +2511,12 @@ RECORD ZNR "zone" *RAT // zone runtime info RAT. Set mainly from separate ZNI
24982511
*s *e *nest SGTARG zn_sgAirTarg // Solar gain (Btuh) target (float) for zone air: all sun thru windows not SGDIST'd to a mass.
24992512
// Added to in cnloads.cpp:loadsSubhr via pointers in SgR entries made monthly
25002513
// in cgsolar.cpp per info in XSURFs made in cncultn.cpp. Used: cnloads.cpp re aqLdSh. */
2501-
*s *e DBL qSgTotSh
2514+
25022515
*s *e *nest SGTARG zn_sgTotShTarg // subhourly part of s g total (Btuh) for zone: air + mass insides.
25032516
// Added to in cnloads.cpp:loadsSubhr via pointers in SgR entries made monthly
25042517
// in cgsolar.cpp per info in XSURFs made in cncultn.cpp. Used: cnztu.cpp re results qSlr */
2518+
*s *e FLOAT qSgTotSh // Total solar gain to room, including transmitted and inward flowing fraction, Btuh
2519+
// = zn_sgTotShTarg.st_tot + inward flowing from ASHWAT glazing
25052520
*h *hide DBL aMassSh // Subhourly mass portion of zn_aqLdHr: sum ha*T to subhourly masses exposed to zone. note 1.
25062521
*s *hide DBL zn_uaInfil // Infiltration UA (uval * area, === heat cap flow), this hour, for aq-,bLdSh and zone w. note 2.
25072522
// === heat capacity of entering air (Btuh/F). Divide by top.airxO for cfm.
@@ -5532,6 +5547,58 @@ RECORD GAIN "gain" *RAT // (zone internal) Gain input and runtime
55325547
// note includes _TOTAL and _UNKNOWN
55335548
*END // GAIN
55345549
//=============================================================================
5550+
RECORD ACCUMULATOR_IVL "accumulator interval sub" *SUBSTRUCT // substruct for one accumulator for one interval
5551+
*prefix acm_
5552+
5553+
*declare "void acm_Copy( const ACCUMULATOR_IVL* src);"
5554+
*declare "void acm_PopulateSubhr( float value);"
5555+
*declare "void acm_Accum( const ACCUMULATOR_IVL* sIvl, bool firstFlg, bool lastFlg, int options=0);"
5556+
5557+
// NOTE: visible prefix used, not *prefix
5558+
// WHY: the name "sum" is treated as reserved and rejected.
5559+
// Visible "acm" prefixes solve avoid that
5560+
INT acmCount // total # of subhrs included
5561+
5562+
FLOAT acmMin // min value seen in interval
5563+
FLOAT acmMean // mean value seen in interval
5564+
FLOAT acmMax // max value seen in interval
5565+
DBL acmSum // sum of values in interval
5566+
5567+
SI acmMinDayOfYear // day of year on which min occurs, 1-365
5568+
SI acmMinDayOfYearST // day of year (standard time) on which min occurs, 1-365
5569+
// can differ from acmMinDayOfYear iff Top.DT=Yes
5570+
SI acmMinHour // hour of day at which min occurs, 0-23
5571+
SI acmMinHourST // hour of day (standard time) at which min occurs, 0-23
5572+
// can differ from acmMinHour iff Top.DT=Yes
5573+
SI acmMinSubhour // subhour within hour at which min occurs, 0 - Top.tp_nSubSteps-1
5574+
5575+
SI acmMaxDayOfYear // day of year on which min occurs, 1-365
5576+
SI acmMaxDayOfYearST // day of year (standard time) on which max occurs, 0-23
5577+
// can differ from acmMaxDayOfYear iff Top.DT=Yes
5578+
SI acmMaxHour // hour of day at which min occurs, 0-23
5579+
SI acmMaxHourST // hour of day (standard time) at which max occurs, 0-23
5580+
// can differ from acmMaxHour iff Top.DT=Yes
5581+
SI acmMaxSubhour // subhour within hour at which min occurs, 0 - Top.tp_nSubSteps-1
5582+
5583+
*END // ACCUMULATOR_IVL
5584+
//=============================================================================
5585+
RECORD ACCUMULATOR "accumulator" *RAT
5586+
*prefix acm_
5587+
5588+
*declare "RC acm_CkF( int options);"
5589+
5590+
// NOTE: visible prefix used, not *prefix
5591+
// WHY: the name "sum" is treated as reserved and rejected.
5592+
// Visible "acm" prefixes solve avoid that
5593+
*s *e FLOAT acmValue; // value being accumulated
5594+
// generally set via probe
5595+
5596+
*y *e *nest ACCUMULATOR_IVL Y // run (aka year or annual)
5597+
*m *e *nest ACCUMULATOR_IVL M // current month
5598+
*d *e *nest ACCUMULATOR_IVL D // current day
5599+
*h *e *nest ACCUMULATOR_IVL H // current hour
5600+
*END // ACCUMULATOR
5601+
//=============================================================================
55355602
RECORD MTR_IVL "meter interval sub" *SUBSTRUCT // substruct for one meter for one interval for entire building
55365603
// use results
55375604

0 commit comments

Comments
 (0)