Skip to content

Commit da754cd

Browse files
authored
Merge pull request #526 from cse-sim/convection
Generalized forced convection model
2 parents 63cb3bd + aa6b1ed commit da754cd

File tree

25 files changed

+9299
-901
lines changed

25 files changed

+9299
-901
lines changed

doc/src/records/door.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,23 @@ Interior convection coefficient adjustment factor. When drInHcModel=INPUT, hc=d
252252
variability: "subhourly")
253253
%>
254254

255+
**drInHcFrcCoeffs=*float array***
256+
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:
258+
259+
hcFrc = hConvF * (drInHcFrcCoeffs[ 1] + drInHcFrcCoeffs[ 2] * ACH ^ drInHcFrcCoeffs[ 3])
260+
261+
where hConvF is the convection adjustment factor (derived from elevation, see Top hConvMod) and ACH is the zone air change rate per hour from the prior simulation step (including heat pump water heater evaporator air flow). This formulation is dangerously flexible, so caution is advised when selecting coefficient values.
262+
263+
The default hcFrc value (used when drInHcFrCoeff is not provided) is hConvF * znHcFrcF * ACH ^ 0.8.
264+
265+
<%= member_table(
266+
units: "Btuh/ft^2^-^o^F",
267+
legal_range: "",
268+
default: "*inherited from parent surface*",
269+
required: "No",
270+
variability: "subhourly") %>
271+
255272
**endDoor**
256273

257274
Indicates the end of the door definition. Alternatively, the end of the door definition can be indicated by the declaration of another object or by END.

doc/src/records/surface.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ END
348348

349349
**sfInHcMult=*float***
350350

351-
Interior convection coefficient adjustment factor. When sfInHcModel=INPUT, hc=sfInHcMult. For other sfInHcModel choices, the model-derived hc is multiplied by sfInHcMult.
351+
Interior convection coefficient adjustment factor. When sfInHcModel=INPUT, hc=sfInHcMult. For other sfInHcModel choices, the model-derived hc is multiplied by sfInHcMult. When sfInHcModel=UNIFIED, natural (buoyancy-driven) and forced convection coefficient values are combined according to TOP inHcCombinationMethod, then sfInHcMult is applied.
352352

353353
<%= member_table(
354354
units: "",
@@ -357,6 +357,24 @@ END
357357
required: "No",
358358
variability: "subhourly") %>
359359

360+
**sfInHcFrcCoeffs=*float array***
361+
362+
Specifies 3 coefficients for an alternative inside surface forced convection model (applicable only for sfInHCModel=UNIFIED). When given, the inside surface forced convection coefficient for this surface is derived as follows:
363+
364+
hcFrc = hConvF * (sfInHcFrcCoeffs[ 1] + scInHcFrcCoeffs[ 2] * ACH ^ sfInHcFrcCoeffs[ 3])
365+
366+
where hConvF is the convection adjustment factor (derived from elevation, see Top hConvMod) and ACH is the zone air change rate per hour from the prior simulation step (including heat pump water heater evaporator air flow). This formulation is dangerously flexible, so caution is advised when selecting coefficient values.
367+
368+
The default hcFrc value (used when sfInHcFrCoeff is not provided) is hConvF * znHcFrcF * ACH ^ 0.8.
369+
370+
<%= member_table(
371+
units: "Btuh/ft^2^-^o^F",
372+
legal_range: "",
373+
default: "*see above*",
374+
required: "No",
375+
variability: "subhourly") %>
376+
377+
360378
The items below give values associated with CSE's model for below grade surfaces (sfExCnd=GROUND). See CSE Engineering Documentation for technical details.
361379

362380
**sfFnd=*fdName***

doc/src/records/top-members.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,27 @@ $$0.24 + 0.76 \cdot P_{Location}/P_{SeaLevel}$$
688688
required: "No",
689689
variability: "constant") %>
690690

691+
**inHcCombinationMethod=*choice***
692+
693+
Selects the method for combining inside face (zone-facing) forced and natural (buoyancy-driven) convection coefficients for surfaces using the UNIFIED convection model. This is a development aid not typically used in production runs.
694+
695+
<%= csv_table(<<END, :row_header => true)
696+
Method, hcComb
697+
SUM, hcNat + hcFrc
698+
QUADRATURE, sqrt(hcNat^2 + hcFrc^2)
699+
WEIGHTED, hcNat when ACH<0.5
700+
, hcFrc when ACH>3.0
701+
, else weighted combination
702+
END
703+
%>
704+
705+
<%= member_table(
706+
units: "",
707+
legal_range: "*choices above*",
708+
default: "SUM",
709+
required: "No",
710+
variability: "constant") %>
711+
691712
**soilDiff=*float***
692713

693714
*Note: soilDiff is used as part of the simple ground model, which is no longer supported. Use soilCond, soilSpHt, and SoilDens instead.*

doc/src/records/window.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ END
184184

185185
**wnExHcModel=*choice***
186186

187-
Selects the model used for exterior surface convection when wnModel = Forward\_Difference.
187+
Selects the model used for exterior surface convection.
188188

189189
<%= member_table(
190190
units: "",
@@ -242,6 +242,23 @@ Interior convection coefficient adjustment factor. When wnInHcModel=INPUT, hc=w
242242
variability: "subhourly")
243243
%>
244244

245+
**wnInHcFrcCoeffs=*float array***
246+
247+
Specifies 3 coefficients for an alternative inside surface forced convection model (applicable only for wnInHCModel=UNIFIED). When given, the inside surface forced convection coefficient for this surface is derived as follows:
248+
249+
hcFrc = hConvF * (wnInHcFrcCoeffs[ 1] + wnInHcFrcCoeffs[ 2] * ACH ^ wnInHcFrcCoeffs[ 3])
250+
251+
where hConvF is the convection adjustment factor (derived from elevation, see Top hConvMod) and ACH is the zone air change rate per hour from the prior simulation step (including heat pump water heater evaporator air flow). This formulation is dangerously flexible, so caution is advised when selecting coefficient values.
252+
253+
The default hcFrc value (used when wnInHcFrCoeff is not provided) is hConvF * znHcFrcF * ACH ^ 0.8.
254+
255+
<%= member_table(
256+
units: "Btuh/ft^2^-^o^F",
257+
legal_range: "",
258+
default: "*inherited from parent surface*",
259+
required: "No",
260+
variability: "subhourly") %>
261+
245262
**wnSHGC=*float***
246263

247264
Rated Solar Heat Gain Coefficient (SHGC) for the window assembly.

doc/src/records/zone.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Zone air exchange rate used in determination of interior surface convective coef
133133

134134
**znHcFrcF=*float***
135135

136-
Zone surface forced convection factor. Interior surface convective transfer is modeled as a combination of forced and natural convection. hcFrc = znHcFrcF * znHcAirX^.8. See CSE Engineering Documentation.
136+
Zone surface forced convection factor. Default interior surface convective transfer is modeled as a combination of forced and natural convection. hcFrc = znHcFrcF * ACH^.8, where ACH = znHcAirX + heat pump water heater evaporator air exchange rate See CSE Engineering Documentation.
137137

138138
<%= member_table(
139139
units: "Btuh/ft^2^-^o^F",

src/CNDTYPES.DEF

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ PIPESEGP -- "class PIPESEG*"
337337
DOE2 "DOE2"
338338
UNIFIED "Unified"
339339
}
340+
*choicb HCCOMBMETH {
341+
SUM "Sum"
342+
WEIGHTED "Weighted"
343+
QUADRATURE "Quadrature"
344+
}
340345
*choicb RSYSTY {
341346
ACFURN "ACFurnace"
342347
ACPMFURN "ACPMFurnace"

src/CNFIELDS.DEF

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ GROUNDMODELCH GROUNDMODELCH LMNONE UNNONE
162162
FBXREFCH FBXREFCH LMNONE UNNONE
163163
FBZREFCH FBZREFCH LMNONE UNNONE
164164
CONVMODELCH CONVMODELCH LMNONE UNNONE
165-
RSYSTY RSYSTY LMNONE UNNONE
165+
HCCOMBMETH HCCOMBMETH LMNONE UNNONE
166+
RSYSTY RSYSTY LMNONE UNNONE
166167
RSYSOAVTYCH RSYSOAVTYCH LMNONE UNNONE
167168
RSYSDEFROSTMODELCH RSYSDEFROSTMODELCH LMNONE UNNONE
168169
AUXHEATTY AUXHEATTY LMNONE UNNONE

src/CNRECS.DEF

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on
283283
// determined by zone that wants the least vent
284284
// or -1 for zonal vent control
285285

286-
*r NOYESCH tp_hConvMod // enable/disable convection convective coefficient pressure modification factor (tp_hConvF below)
287-
// mostly for debugging.
288286
*f SI verbose // screen messages: autosizing: 0 none, 1 some (dflt?), 2-5 more
289287
// -1: suppress progress messages ("Input", "Warmup", etc.) via setScreenQuiet()
290288
*h INT tp_dbgPrintMask // debug print mask, controls DbPrintf() etc., schedulable via std capabilities
@@ -381,11 +379,17 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on
381379
// airRhoK*tp_airSH dfl ~9.535 NEEDS UNITS
382380
*r float airXK // divide by abs temp for specific heat of flow (Btuh/cfm-F)
383381
// airVshK, times 60 to match time units. dfl ~572.1
382+
*r NOYESCH tp_hConvMod // enable/disable convection convective coefficient pressure modification factor (tp_hConvF below)
383+
// mostly for debugging.
384384
*r float tp_hConvF // convective coefficient pressure modification factor
385385
// =(.24 + .76*PresAtm/PresAtmSeaLevel)
386-
// used in some surface transfer models, reduces convection as function of elevation
386+
// reduces convective coefficients as function of elevation
387+
// in some convection modelsPresAtmSeaLevel
387388
// source = ASHRAE 1199-RP Barnaby et al. 2004
388-
// and: enthalpy/lb is airSh * absTemp + 1061 * w. (Btu/lb)
389+
// and: enthalpy/lb is airSh * absTemp + 1061 * w. (Btu/lb)
390+
*r HCCOMBMETH tp_inHcCombMeth // method used to combine inside surface hcNat and hcFrc
391+
// see SBC::sb_CombineInHcNatFrc()
392+
389393

390394
// air property uses:
391395
*declare "float airDens( float t) { return airRhoK / ( t + 459.67f); } // air density for temp lb/ft3"
@@ -1091,6 +1095,7 @@ RECORD SBCBASE "SBCBASE" *SUBSTRUCT *HIDEALL
10911095
*r DBL sb_fSky // "view factor" to radiant surround at sky temp
10921096
*r DBL sb_fAir // "view factor" to radiant surround at air temp (ground, horizon)
10931097

1098+
10941099
*s *e FLOAT_GEZ sb_hcNat // surface natural convection coefficient, Btuh/ft2-F
10951100
*s *e FLOAT_GEZ sb_hcFrc // surface forced (wind) convection coefficient, Btuh/ft2-F
10961101
*s *e FLOAT_GEZ sb_hcMult // surface convection coefficient multiplier, dimless
@@ -1156,21 +1161,22 @@ RECORD SBC "SBC" *SUBSTRUCT *BASECLASS SBCBASE // surface boundary condition su
11561161
*declare "virtual int sb_Class() const;"
11571162
*declare "void sb_CalcAwAbsSlr();"
11581163
*declare "virtual const char* sb_ParentName() const;"
1159-
*declare "int sb_HasHcNat() const;"
1164+
*declare "bool sb_HasHcNat() const;"
1165+
*declare "bool sb_IsSet( int fnSBC) const;"
11601166
*declare "void sb_SetRunConstants( int dbPrint);"
11611167
*declare "void sb_SetCoeffs( double area, double uC);"
11621168
*declare "void sb_HCAmbient();"
11631169
*declare "float sb_CGrnd() const;"
11641170
*declare "void sb_SetCoeffsWallBG( float a[]);"
11651171
*declare "void sb_SetCoeffsFloorBG( float a4, float a5);"
11661172
*declare "void sb_HCZone();"
1173+
*declare "float sb_CombineInHcNatFrc() const;"
11671174
*declare "void sb_SetTx();"
11681175
*declare "double sb_QHT() const { return sb_qrAbs + sb_hxa*sb_txa + sb_hxr*sb_txr; }"
11691176
*declare "void sb_BalCheck();"
11701177
*declare "const char* sb_SideText();"
11711178
*declare "static void sb_DbPrintf( const char* tag, const SBC& sbcO, const SBC& sbcI);"
11721179

1173-
11741180
*r XSURFP sb_pXS // parent pointer
11751181
*r int sb_si // side of *sb_pXS represented by this SBC
11761182
// 0=inside, 1=outside
@@ -1197,6 +1203,11 @@ RECORD SBC "SBC" *SUBSTRUCT *BASECLASS SBCBASE // surface boundary condition su
11971203
*r DBL sb_cosAtv // cos( angle to vertical) 0 - 1 (never < 0)
11981204
*i CONVMODELCH sb_hcModel // surface convective coefficient model
11991205
// specifies calc method sb_hcNat and sb_hcFrc
1206+
*declare "enum { sbhcUSECOEFFS=0x1 };"
1207+
*r SI sb_hcFrcOptions // options re inside forced convection model
1208+
// 1: use sb_hcFrcCoeffs (see code), else zn_hcFrc
1209+
*r *array DIM_HCFRCCOEFFS FLOAT sb_hcFrcCoeffs // coefficients for forced convection model (inside only)
1210+
// 1 extra array member required by cul
12001211
*r FLOAT sb_hcLChar // characteristic length, ft
12011212
// used in derivation of exterior forced convective coeff
12021213
// default = 10 ft
@@ -1388,6 +1399,8 @@ RECORD SFI "surface" *RAT // opaque surface / door / window input info RAT
13881399
*declare "RC sf_CkfSURFGround( int options);"
13891400
*declare "RC sf_CkfDOOR( int options);"
13901401
*declare "RC sf_CkfWINDOW( int options);"
1402+
*declare "RC sf_CkfInsideConvection();"
1403+
*declare "RC sf_SBCConvectionInheritIf( const SFI* pSfParent, int si);"
13911404
*declare "RC sf_TopSf2();"
13921405
*declare "RC sf_MakMs();"
13931406
*declare "RC sf_SetupKiva();"
@@ -2671,10 +2684,12 @@ RECORD ZNR "zone" *RAT // zone runtime info RAT. Set mainly from separate ZNI
26712684
*s *e FLOAT zn_airX // overall zone air change rate (changes/hr)
26722685
// includes *all* air flows; used re convective coeff determination
26732686

2674-
// *s *e FLOAT i.zn_hcAirX // zn_airX + add'l 4.8 ACH for non-air zones having HVAC loads
2687+
// *s *e FLOAT i.zn_hcAirX // zn_airX + add'l 4.8 ACH for non-air zones having HVAC loads, changes/hr
26752688
// inputable for testing; used re convection coeff model
2676-
*s FLOAT zn_hcAirXls // prior subhour value of i.zn_hcAirX
2677-
*s FLOAT zn_hcFrc // inside surface forced convection coefficient, Btuh/ft2-F
2689+
*s FLOAT zn_hcAirXls // prior subhour value of i.zn_hcAirX, change/hr
2690+
*s *e FLOAT zn_hcAirXComb // combined zone air change rate for this subhour, changes/hr
2691+
// = zn_hcAirXls + zn_hpwhAirX
2692+
*s *e FLOAT zn_hcFrc // inside surface forced convection coefficient, Btuh/ft2-F
26782693
*s FLOAT zn_windPresV // wind velocity pressure, lbf/ft2
26792694
// zone-specific per zn_EaveZ and zn_infShield
26802695

src/ancrec.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,19 @@ record::record(BP _b, TI i, SI noZ/*=0*/) // construct record i of basAnc b, z
5858
r_status = 1; // say space in use and record good
5959
} // record::record
6060
//---------------------------------------------------------------------------------------------------------------------------
61-
void* record::field( int fn) // point to member in record by FIELD #
62-
{ return (void *)((char *)this + b->fir[fn].fi_off); }
63-
//-----------------------------------------------------------------------------
64-
const void* record::field( int fn) const
65-
{ return (const void *)((const char *)this + b->fir[fn].fi_off); }
66-
//-----------------------------------------------------------------------------
6761
void record::RRFldCopy( // record-to-record field copy
68-
const record* r, // source record (same type as this)
62+
const record* rSrc, // source record (same type as this)
6963
int fn) // field #
7064
// handles NaNs re expressions
7165
{
7266
#if defined( _DEBUG)
73-
if (b->rt != r->b->rt)
67+
if (b->rt != rSrc->b->rt)
7468
err( PWRN, "%s:%s RRFldCopy: RT mismatch", b->what, Name());
7569
#endif
7670
int dt = DType( fn);
7771
int sz = GetDttab( dt).size;
78-
memcpy( field( fn), r->field( fn), sz);
79-
fStat( fn) = r->fStat( fn);
72+
memcpy( field( fn), rSrc->field( fn), sz);
73+
fStat( fn) = rSrc->fStat( fn);
8074
} // record::RRFldCopy
8175
//-----------------------------------------------------------------------------
8276
void record::FldCopy( // field-to-field copy (within record)
@@ -749,8 +743,8 @@ RC record::ArrayCheck( // check array input for expected count
749743
msg = strtprintf("%d to %d", nSetExpectedMin, nSetExpectedMax);
750744
}
751745
if (msg)
752-
rc |= oer("%d values found for array '%s' (expected %s)",
753-
nSet, mbrIdTx(fn), msg);
746+
rc |= oer("%d value%s found for array '%s' (expected %s)",
747+
nSet, nSet==1 ? "" : "s", mbrIdTx(fn), msg);
754748
}
755749
}
756750
return rc;

src/ancrec.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,19 @@ class record // base class for records
182182
record() {} // cannot construct record without basAnc and subscript
183183
public:
184184
const char* Name() const { return name.CStr(); }
185-
void* field( int fn); // point to member in record by FIELD #
186-
const void* field( int fn) const;
185+
void* field( int fn) // point to member in record by FIELD #
186+
{ return (void *)((char *)this + b->fir[fn].fi_off); }
187+
const void* field( int fn) const
188+
{ return (const void *)((const char *)this + b->fir[fn].fi_off); }
189+
const char* mbrName(int fn) const { return b->fir[fn].fi_mName; }
190+
187191
int DType(int fn) const;
188192

189-
void RRFldCopy( const record* r, int fn);
190-
int RRFldCopyIf( const record* r, int fn)
193+
void RRFldCopy( const record* rSrc, int fn);
194+
int RRFldCopyIf( const record* rSrc, int fn)
191195
{ int ret = !IsSet( fn);
192196
if (ret)
193-
RRFldCopy( r, fn);
197+
RRFldCopy( rSrc, fn);
194198
return ret;
195199
}
196200
void FldCopy( int fnS, int fnD);

0 commit comments

Comments
 (0)