Skip to content

Improve-unit-handling-hpwh #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6f4611f
Merge main.
spahrenk Aug 19, 2024
734c65e
Reset HPWHsim SHA.
spahrenk Aug 19, 2024
5794d1e
Fix energy units,
spahrenk Aug 20, 2024
501d0c4
Update HPWHsim
spahrenk Aug 20, 2024
af53aba
Update HPWHsim.
spahrenk Aug 21, 2024
84b8365
Use Units library.
spahrenk Aug 21, 2024
c66b695
Add conversion factors.
spahrenk Aug 22, 2024
395788f
Update HPWWsim.
spahrenk Sep 9, 2024
96d0286
Set kiva branch.
spahrenk Sep 10, 2024
dbf0932
Update HPWHsim.
Sep 11, 2024
661afac
Update HPWHsim.
spahrenk Sep 16, 2024
247fc32
Update HPWHsim.
spahrenk Sep 16, 2024
897f336
Replace mac refs.
spahrenk Sep 16, 2024
4909f92
Merge branch 'develop-units-hpwh' of https://github.com/cse-sim/cse i…
Sep 16, 2024
9a7c926
Update win32 refs.
Sep 16, 2024
1c45725
Format.
Sep 16, 2024
3d959f0
Reformat.
spahrenk Sep 16, 2024
a3e00a4
Merge develop-hpwh.
spahrenk Sep 16, 2024
a1c0273
Fix formatting; define Btu_per_Wh.
spahrenk Sep 16, 2024
535dd2b
Update refs.
spahrenk Sep 16, 2024
aea2817
Update ref.
spahrenk Sep 16, 2024
a9ed425
Update ref.
spahrenk Sep 16, 2024
2a97207
Restore format.
spahrenk Sep 16, 2024
d96afb5
Update refs.
spahrenk Sep 16, 2024
b6849cf
Update refs.
spahrenk Sep 16, 2024
833e9b1
Restore formatting.
spahrenk Sep 16, 2024
9426819
Replace ref.
Sep 17, 2024
f1a699e
Update HPWHsim.
spahrenk Sep 19, 2024
d95182d
Update HPWHsim.
spahrenk Sep 19, 2024
60c5498
Replace Mac refs.
spahrenk Sep 19, 2024
d0cb62e
Update Win refs.
Sep 19, 2024
937d94c
Add ref.
Sep 19, 2024
54ca729
Update HPWHsim.
spahrenk Sep 20, 2024
01080b4
Update HPWHsim.
spahrenk Sep 20, 2024
a753e19
Update HPWHsim.
spahrenk Sep 22, 2024
4ff645e
Merge main.
spahrenk Oct 1, 2024
56907bb
Update refs.
spahrenk Oct 1, 2024
666546f
Merge main.
spahrenk Nov 13, 2024
d602d94
Fix merge errors.
spahrenk Nov 13, 2024
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
281 changes: 143 additions & 138 deletions src/dhwcalc.cpp

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/dhwsolar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#include "cnculti.h"
#include "solar.h"

#include "HPWH.hh"
static const float Btu_per_Wh = Unity::scale(Units::Wh, Units::Btu)();

///////////////////////////////////////////////////////////////////////////////
// DHWSOLARSYS: represents a solar water heating system
// 1 or more collectors + tank + pump
Expand Down Expand Up @@ -184,7 +187,7 @@ RC DHWSOLARSYS::sw_EndIvl(

// Add parasitics to meter
if (sw_pMtrElec)
sw_pMtrElec->H.mtr_AccumEU(sw_endUse, sw_parElec * BtuperWh);
sw_pMtrElec->H.mtr_AccumEU(sw_endUse, sw_parElec * Btu_per_Wh);

DHWSOLARCOLLECTOR* pSC;
RLUPC(ScR, pSC, pSC->ownTi == ss)
Expand Down Expand Up @@ -383,8 +386,8 @@ RC DHWSOLARCOLLECTOR::sc_Init()
if (!IsSet(DHWSOLARCOLLECTOR_PUMPPWR))
sc_pumpPwr = 10.f * sc_oprVolFlow;

sc_tickPumpQ = sc_pumpPwr * BtuperWh * Top.tp_tickDurHr; // pump energy per tick, Btu
sc_pumpDT = sc_pumpLiqHeatF * sc_pumpPwr * BtuperWh / sc_oprMCp; // temp rise through pump
sc_tickPumpQ = sc_pumpPwr * Btu_per_Wh * Top.tp_tickDurHr; // pump energy per tick, Btu
sc_pumpDT = sc_pumpLiqHeatF * sc_pumpPwr * Btu_per_Wh / sc_oprMCp; // temp rise through pump

// piping (sc_oprVolFlow must be known)
rc |= sc_InitPiping();
Expand Down
216 changes: 108 additions & 108 deletions test/ref-macos64-appleclang/CHDHW.REP

Large diffs are not rendered by default.

132 changes: 66 additions & 66 deletions test/ref-macos64-appleclang/DHWDU.rep

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions test/ref-macos64-appleclang/DHWLS.rep
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ DSMH1 for Wed 01-Apr
4 54.306 54.306 0.12 0 0.12 62.89 0 62.89 62.89
5 54.306 54.306 0.55 0 0.55 300.62 0 300.62 300.62
6 54.306 54.306 0.038 0 0.038 20.96 0 20.96 20.96
7 54.306 54.306 11.23 10.25 11.23 6115.3 0 6115.3 6115.3
7 54.306 54.306 11.23 10.25 11.23 6115.4 0 6115.4 6115.4
8 54.306 54.306 11.24 6.57 11.24 6121.3 0 6121.3 6121.3
9 54.306 54.306 8.91 0 8.91 4854.1 0 4854.1 4854.1
10 54.306 54.306 20.68 16.15 20.68 11265 0 11265 11265
Expand All @@ -83,7 +83,7 @@ DSMH1 for Wed 01-Apr
14 54.306 54.306 0.043 0 0.043 23.56 0 23.56 23.56
15 54.306 54.306 0.038 0 0.038 20.96 0 20.96 20.96
16 54.306 54.306 0.72 0 0.72 390.07 0 390.07 390.07
17 54.306 54.306 1.24 0 1.24 674.50 0 674.50 674.50
17 54.306 54.306 1.24 0 1.24 674.51 0 674.51 674.51
18 54.306 54.306 2.18 0 2.18 1187.4 0 1187.4 1187.4
19 54.306 54.306 4.73 0 4.73 2574.9 0 2574.9 2574.9
20 54.306 54.306 16.36 13.66 16.36 8911.8 0 8911.8 8911.8
Expand Down Expand Up @@ -167,16 +167,16 @@ DSMH2a for Wed 01-Apr
4 54.306 54.306 0.077 0 0.077 41.93 0 41.93 41.93
5 54.306 54.306 0.038 0 0.038 20.96 0 20.96 20.96
6 54.306 54.306 0 0 0 0 0 0 0
7 54.306 54.306 11.23 10.25 11.23 6115.3 0 6115.3 6115.3
7 54.306 54.306 11.23 10.25 11.23 6115.4 0 6115.4 6115.4
8 54.306 54.306 8.92 6.57 8.92 4858.4 0 4858.4 4858.4
9 54.306 54.306 4.86 0 4.86 2647.6 0 2647.6 2647.6
10 54.306 54.306 17.36 16.15 17.36 9455.4 0 9455.4 9455.4
11 54.306 54.306 0 0 0 0 0 0 0
12 54.306 54.306 0.86 0.75 0.86 469.38 0 469.38 469.38
12 54.306 54.306 0.86 0.75 0.86 469.39 0 469.39 469.39
13 54.306 54.306 13.08 12.82 13.08 7120.9 0 7120.9 7120.9
14 54.306 54.306 0 0 0 0 0 0 0
15 54.306 54.306 0.038 0 0.038 20.96 0 20.96 20.96
16 54.306 54.306 0.44 0 0.44 238.13 0 238.13 238.13
16 54.306 54.306 0.44 0 0.44 238.14 0 238.14 238.14
17 54.306 54.306 0.91 0 0.91 494.07 0 494.07 494.07
18 54.306 54.306 0.25 0 0.25 135.98 0 135.98 135.98
19 54.306 54.306 2.97 0 2.97 1615.7 0 1615.7 1615.7
Expand Down Expand Up @@ -284,7 +284,7 @@ DSMH2b for Wed 01-Apr

! Log for Run 001:

! CSE 0.920.0+main.99c64c5b.17 for Win32 console
! CSE 0.922.1+develop-units-hpwh.2a972077.83 for Win32 console



Expand Down Expand Up @@ -4852,18 +4852,18 @@ Input for Run 001:



! CSE 0.920.0+main.99c64c5b.17 for Win32 console run(s) done: Mon 18-Dec-23 4:17:53 pm
! CSE 0.922.1+develop-units-hpwh.2a972077.83 for Win32 console run(s) done: Mon 16-Sep-24 3:03:51 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)
! Executable: /users/phil-ahrenkiel/documents/github/cse/build/cse-appleclang-64
! ? (enExeInfo fail) (HPWH 1.23.0+develop-units.4f05158.307)
! Command line: -x! -b -t1 dhwls
! Input file: D:\cse\test\dhwls.cse
! Report file: D:\CSE\TEST\DHWLS.REP
! Input file: /Users/phil-ahrenkiel/Documents/GitHub/cse/test/dhwls.cse
! Report file: /USERS/PHIL-AHRENKIEL/DOCUMENTS/GITHUB/CSE/TEST/DHWLS.REP

! Timing info --

! Input: Time = 0.56 Calls = 1 T/C = 0.5640
! Input: Time = 0.53 Calls = 1 T/C = 0.5300
! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000
! Simulation: Time = 0.72 Calls = 1 T/C = 0.7180
! Reports: Time = 0.01 Calls = 1 T/C = 0.0060
! Total: Time = 1.29 Calls = 1 T/C = 1.2900
! Simulation: Time = 0.54 Calls = 1 T/C = 0.5410
! Reports: Time = 0.01 Calls = 1 T/C = 0.0050
! Total: Time = 1.08 Calls = 1 T/C = 1.0770
74 changes: 37 additions & 37 deletions test/ref-macos64-appleclang/DHW_AQUATHERMAIRE.REP
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,25 @@ DHWSYS (kBtu)
Mon qOutDHW qOutHtg qLMisc qLLoop qDWHR qSSF qSolar qPrimWH qLossWH qAuxWH qStorWH qErrWH qPrimLH qLossLH qAuxLH qStorLH qErrWH qXBUDHW qXBUHtg qBal COP
--- ------- ------- ------ ------ ------ ------ ------ ------- ------- ------ ------- ------- ------- ------- ------ ------- ------- ------- ------- ------ --------
Jan 765.086 0 0 0 0 0 0 1005.85 -243.94 0 -0.406 -0.0000 0 0 0 0 0 0.955 0 2.635 1.977
Feb 893.895 0 0 0 0 0 0 1106.92 -214.01 0 -4.149 -0.0000 0 0 0 0 0 2.760 0 2.371 2.145
Mar 835.582 0 0 0 0 0 0 1048.88 -216.59 0 -0.667 -0.0000 0 0 0 0 0 0.880 0 3.077 2.414
Apr 838.404 0 0 0 0 0 0 1047.18 -213.89 0 2.408 -0.0000 0 0 0 0 0 0.452 0 2.253 2.376
May 827.603 0 0 0 0 0 0 1032.06 -203.70 0 -2.815 -0.0000 0 0 0 0 0 0.106 0 1.958 2.693
Jun 733.233 0 0 0 0 0 0 914.243 -182.07 0 -0.0155 -0.0000 0 0 0 0 0 0.00771 0 1.063 3.085
Jul 583.506 0 0 0 0 0 0 767.271 -185.42 0 1.261 -0.0000 0 0 0 0 0 0.0116 0 0.380 2.791
Aug 607.153 0 0 0 0 0 0 790.249 -186.07 0 2.399 -0.0000 0 0 0 0 0 0.00958 0 0.561 2.844
Sep 608.587 0 0 0 0 0 0 800.494 -190.61 0 -1.956 -0.0000 0 0 0 0 0 0.00977 0 0.645 2.637
Oct 629.014 0 0 0 0 0 0 831.237 -207.53 0 4.039 -0.0000 0 0 0 0 0 0.0142 0 1.252 2.401
Nov 743.632 0 0 0 0 0 0 962.522 -221.32 0 0.360 -0.0000 0 0 0 0 0 0.0505 0 2.020 2.183
Dec 803.454 0 0 0 0 0 0 1043.89 -243.25 0 -0.458 -0.0000 0 0 0 0 0 0.649 0 2.627 2.002
Feb 893.896 0 0 0 0 0 0 1106.92 -214.01 0 -4.149 .000001 0 0 0 0 0 2.760 0 2.371 2.145
Mar 835.583 0 0 0 0 0 0 1048.89 -216.59 0 -0.667 .000001 0 0 0 0 0 0.880 0 3.077 2.414
Apr 838.405 0 0 0 0 0 0 1047.18 -213.89 0 2.408 -0.0000 0 0 0 0 0 0.452 0 2.253 2.376
May 827.604 0 0 0 0 0 0 1032.06 -203.70 0 -2.815 -0.0000 0 0 0 0 0 0.106 0 1.958 2.693
Jun 733.234 0 0 0 0 0 0 914.244 -182.07 0 -0.0155 -0.0000 0 0 0 0 0 0.00771 0 1.063 3.085
Jul 583.506 0 0 0 0 0 0 767.272 -185.42 0 1.261 .000001 0 0 0 0 0 0.0116 0 0.380 2.791
Aug 607.154 0 0 0 0 0 0 790.250 -186.07 0 2.399 0.0000 0 0 0 0 0 0.00958 0 0.561 2.844
Sep 608.588 0 0 0 0 0 0 800.495 -190.61 0 -1.956 -0.0000 0 0 0 0 0 0.00977 0 0.645 2.637
Oct 629.015 0 0 0 0 0 0 831.238 -207.53 0 4.039 -0.0000 0 0 0 0 0 0.0142 0 1.252 2.401
Nov 743.633 0 0 0 0 0 0 962.523 -221.32 0 0.360 -0.0000 0 0 0 0 0 0.0505 0 2.020 2.183
Dec 803.454 0 0 0 0 0 0 1043.89 -243.25 0 -0.458 0.0000 0 0 0 0 0 0.649 0 2.627 2.002

Yr 8869.15 0 0 0 0 0 0 11350.8 -2508.4 0 -.00001 -0.0000 0 0 0 0 0 5.906 0 20.842 2.394
Yr 8869.16 0 0 0 0 0 0 11350.8 -2508.4 0 .000028 -.00001 0 0 0 0 0 5.906 0 20.842 2.394



! Log for Run 001:

! CSE 0.922.1+reduce-boost-kiva.e6833eb8.35 for Win32 console
! CSE 0.922.1+develop-units-hpwh.4ff645e2.114 for Win32 console



Expand Down Expand Up @@ -3663,7 +3663,7 @@ Warning: Zone 'Garage-grg': Condensation occurred in 778 subhours of run.
Total condensation heat = 303.333 kBtu.
---------------
Warning: Zone 'Gar Attic -atc': Condensation occurred in 1064 subhours of run.
Total condensation heat = 2.22045 kBtu.
Total condensation heat = 2.22046 kBtu.
---------------


Expand All @@ -3688,7 +3688,7 @@ May 1735.4 0 0 0 353.99 0 0 57.088 0 40.946 0
Jun 1694.6 70.876 0 0 278.37 0 0 111.78 0 39.625 0 0 0 291.62 590.04 45.278 187.67 28.277 0 51.077 0 0 0 0 0
Jul 1883.7 222.50 0 0 229.59 0 0 132.05 0 40.946 0 0 0 308.88 624.95 46.787 193.92 29.950 0 54.099 0 0 0 0 0
Aug 1892.1 154.58 0 0 236.75 0 0 126.78 0 40.946 0 0 0 331.48 670.67 46.787 193.92 32.141 0 58.058 0 0 0 0 0
Sep 1806.3 0 0 0 264.89 0 0 91.613 0 39.625 0 0 0 357.24 722.79 45.278 187.67 34.639 0 62.570 0 0 0 0 0
Sep 1806.3 0 0 0 264.90 0 0 91.613 0 39.625 0 0 0 357.24 722.79 45.278 187.67 34.639 0 62.570 0 0 0 0 0
Oct 1957.4 0 0 0 308.84 0 0 38.402 0.301 40.946 0 0 0 403.04 815.48 46.787 193.92 39.081 0 70.593 0 0 0 0 0
Nov 2088.9 0 0 0 397.23 0 0 0 23.987 39.680 0 0 0 423.06 856.52 45.278 187.93 41.047 0 74.146 0 0 0 0 0
Dec 2368.4 0 0 0 466.24 0 0 0 118.47 40.946 0 0 0 455.78 922.18 46.787 193.92 44.194 0 79.830 0 0 .00534 0 0
Expand Down Expand Up @@ -3723,25 +3723,25 @@ DHWSYS (kBtu)
Mon qOutDHW qOutHtg qLMisc qLLoop qDWHR qSSF qSolar qPrimWH qLossWH qAuxWH qStorWH qErrWH qPrimLH qLossLH qAuxLH qStorLH qErrWH qXBUDHW qXBUHtg qBal COP
--- ------- ------- ------ ------ ------ ------ ------ ------- ------- ------ ------- ------- ------- ------- ------ ------- ------- ------- ------- ------ --------
Jan 765.086 0 0 0 0 0 0 1030.38 -270.32 0 1.118 -0.0000 0 0 0 0 0 0.419 0 3.485 1.692
Feb 893.895 0 0 0 0 0 0 1126.73 -241.72 0 3.780 -0.0000 0 0 0 0 0 0.426 0 4.684 1.845
Mar 835.582 0 0 0 0 0 0 1081.13 -239.98 0 -9.057 -0.0000 0 0 0 0 0 0 0 3.494 2.025
Apr 838.404 0 0 0 0 0 0 1074.00 -239.32 0 0.457 -0.0000 0 0 0 0 0 0 0 3.262 2.064
May 827.603 0 0 0 0 0 0 1054.77 -229.40 0 -1.060 -0.0000 0 0 0 0 0 0 0 3.294 2.338
Jun 733.233 0 0 0 0 0 0 936.351 -208.85 0 3.504 -0.0000 0 0 0 0 0 0 0 2.229 2.634
Jul 583.506 0 0 0 0 0 0 799.180 -215.30 0 -2.020 -0.0000 0 0 0 0 0 0 0 1.645 2.542
Aug 607.153 0 0 0 0 0 0 814.485 -213.16 0 3.662 -0.0000 0 0 0 0 0 0 0 2.165 2.565
Sep 608.587 0 0 0 0 0 0 827.373 -217.67 0 -3.184 -0.0000 0 0 0 0 0 0 0 2.072 2.297
Oct 629.014 0 0 0 0 0 0 863.435 -235.60 0 -1.589 -0.0000 0 0 0 0 0 0 0 2.767 2.037
Nov 743.632 0 0 0 0 0 0 986.929 -247.49 0 1.204 -0.0000 0 0 0 0 0 0 0 2.990 1.872
Dec 803.454 0 0 0 0 0 0 1068.00 -272.28 0 3.184 -0.0000 0 0 0 0 0 0.00534 0 4.545 1.723
Feb 893.896 0 0 0 0 0 0 1126.73 -241.72 0 3.780 .000001 0 0 0 0 0 0.426 0 4.684 1.845
Mar 835.583 0 0 0 0 0 0 1081.13 -239.98 0 -9.057 .000001 0 0 0 0 0 0 0 3.494 2.025
Apr 838.405 0 0 0 0 0 0 1074.00 -239.32 0 0.457 -0.0000 0 0 0 0 0 0 0 3.262 2.064
May 827.604 0 0 0 0 0 0 1054.77 -229.40 0 -1.060 -0.0000 0 0 0 0 0 0 0 3.294 2.338
Jun 733.234 0 0 0 0 0 0 936.352 -208.85 0 3.504 -0.0000 0 0 0 0 0 0 0 2.229 2.634
Jul 583.506 0 0 0 0 0 0 799.181 -215.30 0 -2.020 .000001 0 0 0 0 0 0 0 1.645 2.542
Aug 607.154 0 0 0 0 0 0 814.486 -213.16 0 3.662 0.0000 0 0 0 0 0 0 0 2.165 2.565
Sep 608.588 0 0 0 0 0 0 827.374 -217.67 0 -3.184 -0.0000 0 0 0 0 0 0 0 2.072 2.297
Oct 629.015 0 0 0 0 0 0 863.436 -235.60 0 -1.589 -0.0000 0 0 0 0 0 0 0 2.767 2.037
Nov 743.633 0 0 0 0 0 0 986.930 -247.49 0 1.204 -0.0000 0 0 0 0 0 0 0 2.990 1.872
Dec 803.454 0 0 0 0 0 0 1068.00 -272.28 0 3.184 0.0000 0 0 0 0 0 0.00534 0 4.545 1.723

Yr 8869.15 0 0 0 0 0 0 11662.8 -2831.1 0 .000021 -0.0000 0 0 0 0 0 0.850 0 36.631 2.067
Yr 8869.16 0 0 0 0 0 0 11662.8 -2831.1 0 .000053 -.00001 0 0 0 0 0 0.850 0 36.630 2.067



! Log for Run 002:

! CSE 0.922.1+reduce-boost-kiva.e6833eb8.35 for Win32 console
! CSE 0.922.1+develop-units-hpwh.4ff645e2.114 for Win32 console



Expand All @@ -3760,18 +3760,18 @@ Input for Run 002:



! CSE 0.922.1+reduce-boost-kiva.e6833eb8.35 for Win32 console run(s) done: Tue 10-Sep-24 10:55:15 am
! CSE 0.922.1+develop-units-hpwh.4ff645e2.114 for Win32 console run(s) done: Tue 01-Oct-24 11:00:38 am

! Executable: /users/neal-kruis/projects/cse/builds/clion-release/cse-appleclang-64
! ? (enExeInfo fail) (HPWH 1.23.0+HEAD.db504de.130)
! Executable: /users/phil-ahrenkiel/documents/github/cse/build/cse-appleclang-64
! ? (enExeInfo fail) (HPWH 1.23.0+develop-units.bd2293d.337)
! Command line: -x! -b -t1 dhw_aquathermaire
! Input file: /Users/neal-kruis/projects/cse/test/dhw_aquathermaire.cse
! Report file: /USERS/NEAL-KRUIS/PROJECTS/CSE/TEST/DHW_AQUATHERMAIRE.REP
! Input file: /Users/phil-ahrenkiel/Documents/GitHub/cse/test/dhw_aquathermaire.cse
! Report file: /USERS/PHIL-AHRENKIEL/DOCUMENTS/GITHUB/CSE/TEST/DHW_AQUATHERMAIRE.REP

! Timing info --

! Input: Time = 0.81 Calls = 2 T/C = 0.4050
! Input: Time = 0.15 Calls = 2 T/C = 0.0745
! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000
! Simulation: Time = 60.25 Calls = 2 T/C = 30.1245
! Reports: Time = 0.01 Calls = 2 T/C = 0.0030
! Total: Time = 61.07 Calls = 1 T/C = 61.0700
! Simulation: Time = 10.74 Calls = 2 T/C = 5.3720
! Reports: Time = 0.00 Calls = 2 T/C = 0.0015
! Total: Time = 10.90 Calls = 1 T/C = 10.8970
Loading
Loading