Skip to content

Commit

Permalink
Merge pull request #158 from EcotopeResearch/add_hpts_preset
Browse files Browse the repository at this point in the history
Add HPTS presets
  • Loading branch information
chipbarnaby committed Jan 19, 2023
2 parents 6b43104 + 89a9eb8 commit cf6efe1
Show file tree
Hide file tree
Showing 29 changed files with 16,870 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/HPWH.in.hh
Expand Up @@ -88,6 +88,10 @@ class HPWH {
MODELS_AOSmithHPTU80_DR = 107, /**< 80 gallon AOSmith HPTU */
MODELS_AOSmithCAHP120 = 108, /**< 12 gallon AOSmith CAHP commercial grade */

MODELS_AOSmithHPTS50 = 1101, /**< 50 gallon, AOSmith HPTS */
MODELS_AOSmithHPTS66 = 1102, /**< 66 gallon, AOSmith HPTS */
MODELS_AOSmithHPTS80 = 1103, /**< 80 gallon, AOSmith HPTS */

// GE Models
MODELS_GE2012 = 110, /**< The 2012 era GeoSpring */
MODELS_GE2014STDMode = 111, /**< 2014 GE model run in standard mode */
Expand Down
92 changes: 91 additions & 1 deletion src/HPWHpresets.cc
Expand Up @@ -2405,7 +2405,97 @@ int HPWH::HPWHinit_presets(MODELS presetNum) {
setOfSources[1].companionHeatSource = &setOfSources[2];

}
else if (presetNum == MODELS_GE2014STDMode) {
else if (MODELS_AOSmithHPTS50 <= presetNum && presetNum <= MODELS_AOSmithHPTS80)
{
numNodes = 12;
tankTemps_C = new double[numNodes];
setpoint_C = F_TO_C(127.0);

if (presetNum == MODELS_AOSmithHPTS50) {
tankVolume_L = GAL_TO_L(45.6);
tankUA_kJperHrC = 6.403;
}
else if (presetNum == MODELS_AOSmithHPTS66) {
tankVolume_L = GAL_TO_L(67.63);
tankUA_kJperHrC = UAf_TO_UAc(1.5) * 6.403 / UAf_TO_UAc(1.16);
}
else if (presetNum == MODELS_AOSmithHPTS80) {
tankVolume_L = GAL_TO_L(81.94);
tankUA_kJperHrC = UAf_TO_UAc(1.73) * 6.403 / UAf_TO_UAc(1.16);
}
doTempDepression = false;
tankMixesOnDraw = true;

numHeatSources = 3;
setOfSources = new HeatSource[numHeatSources];

HeatSource compressor(this);
HeatSource resistiveElementTop(this);
HeatSource resistiveElementBottom(this);

compressor.isOn = false;
compressor.isVIP = false;
compressor.typeOfHeatSource = TYPE_compressor;
compressor.setCondensity(0, 0.2, 0.2, 0.2, 0.2, 0.2, 0, 0, 0, 0, 0, 0);

// performance map
compressor.perfMap.reserve(3);

compressor.perfMap.push_back({
50, // Temperature (T_F)
{66.82, 2.49, 0.0}, // Input Power Coefficients (inputPower_coeffs)
{8.64, -0.0436, 0.0} // COP Coefficients (COP_coeffs)
});

compressor.perfMap.push_back({
67.5, // Temperature (T_F)
{85.1, 2.38, 0.0}, // Input Power Coefficients (inputPower_coeffs)
{10.82, -0.0551, 0.0} // COP Coefficients (COP_coeffs)
});

compressor.perfMap.push_back({
95, // Temperature (T_F)
{89, 2.62, 0.0}, // Input Power Coefficients (inputPower_coeffs)
{12.52, -0.0534, 0.0} // COP Coefficients (COP_coeffs)
});

compressor.minT = F_TO_C(37.);
compressor.maxT = F_TO_C(120.);
compressor.hysteresis_dC = dF_TO_dC(1.);
compressor.configuration = HeatSource::CONFIG_WRAPPED;
compressor.maxSetpoint_C = MAXOUTLET_R134A;

resistiveElementTop.setupAsResistiveElement(8, 4500);
resistiveElementTop.isVIP = true;

resistiveElementBottom.setupAsResistiveElement(0, 4500);
resistiveElementBottom.hysteresis_dC = dF_TO_dC(2);

//logic conditions
double compStart = dF_TO_dC(30.2);
double standbyT = dF_TO_dC(9);
compressor.addTurnOnLogic(HPWH::bottomThird(compStart));
compressor.addTurnOnLogic(HPWH::standby(standbyT));

resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(11.87)));

//set everything in its places
setOfSources[0] = resistiveElementTop;
setOfSources[1] = resistiveElementBottom;
setOfSources[2] = compressor;

//and you have to do this after putting them into setOfSources, otherwise
//you don't get the right pointers
setOfSources[2].backupHeatSource = &setOfSources[1];
setOfSources[1].backupHeatSource = &setOfSources[2];

setOfSources[0].followedByHeatSource = &setOfSources[2];
setOfSources[1].followedByHeatSource = &setOfSources[2];

setOfSources[0].companionHeatSource = &setOfSources[2];
}

else if (presetNum == MODELS_GE2014STDMode) {
numNodes = 12;
tankTemps_C = new double[numNodes];
setpoint_C = F_TO_C(127.0);
Expand Down
101 changes: 101 additions & 0 deletions test/AOSmithHPTS50.txt
@@ -0,0 +1,101 @@
numNodes 12 #number of nodes
setpoint 127 F
volume 45.6 gal
UA 6.403 kJperHrC
depressTemp false
mixOnDraw true

numHeatSources 3

heatsource 2 isVIP false
heatsource 2 isOn false
heatsource 2 type compressor
heatsource 2 condensity 0 0.2 0.2 0.2 0.2 0.2 0 0 0 0 0


heatsource 2 nTemps 3
heatsource 2 T1 50 F
heatsource 2 T2 67.5 F
heatsource 2 T3 95 F
heatsource 2 inPowT1const 66.82
heatsource 2 inPowT1lin 2.49
heatsource 2 inPowT1quad 0
heatsource 2 inPowT2const 85.1
heatsource 2 inPowT2lin 2.38
heatsource 2 inPowT2quad 0
heatsource 2 inPowT3const 89
heatsource 2 inPowT3lin 2.62
heatsource 2 inPowT3quad 0
heatsource 2 copT1const 8.64
heatsource 2 copT1lin -0.0436
heatsource 2 copT1quad 0
heatsource 2 copT2const 10.82
heatsource 2 copT2lin -0.0551
heatsource 2 copT2quad 0.0
heatsource 2 copT3const 12.52
heatsource 2 copT3lin -0.0534
heatsource 2 copT3quad 0.0
heatsource 2 minT 37 F
heatsource 2 maxT 120 F
heatsource 2 hysteresis 1 F
heatsource 2 coilConfig wrapped


heatsource 0 isVIP true
heatsource 0 isOn false
heatsource 0 type resistor
heatsource 0 condensity 0 0 0 0 0 0 0 0 1 0 0 0
heatsource 0 nTemps 2
heatsource 0 T1 50 F
heatsource 0 T2 67 F
heatsource 0 inPowT1const 4500
heatsource 0 inPowT1lin 0.0
heatsource 0 inPowT1quad 0.0
heatsource 0 inPowT2const 4500
heatsource 0 inPowT2lin 0.0
heatsource 0 inPowT2quad 0.0
heatsource 0 copT1const 1.0
heatsource 0 copT1lin 0.0
heatsource 0 copT1quad 0.0
heatsource 0 copT2const 1.0
heatsource 0 copT2lin 0.0
heatsource 0 copT2quad 0.0
heatsource 0 hysteresis 0 F
heatsource 0 coilConfig submerged


heatsource 1 isVIP false
heatsource 1 isOn false
heatsource 1 type resistor
heatsource 1 condensity 1 0 0 0 0 0 0 0 0 0 0 0
heatsource 1 nTemps 2
heatsource 1 T1 47 F
heatsource 1 T2 67 F
heatsource 1 inPowT1const 4500
heatsource 1 inPowT1lin 0.0
heatsource 1 inPowT1quad 0.0
heatsource 1 inPowT2const 4500
heatsource 1 inPowT2lin 0.0
heatsource 1 inPowT2quad 0.0
heatsource 1 copT1const 1.0
heatsource 1 copT1lin 0.0
heatsource 1 copT1quad 0.0
heatsource 1 copT2const 1.0
heatsource 1 copT2lin 0.0
heatsource 1 copT2quad 0.0
heatsource 1 hysteresis 2 F
heatsource 1 coilConfig submerged


heatsource 0 onlogic topThird 11.87 F

heatsource 2 onlogic bottomThird 30.2 F
heatsource 2 onlogic standby 9 F

heatsource 1 backupSource 2
heatsource 2 backupSource 1

heatsource 0 followedBySource 2
heatsource 1 followedBySource 2

heatsource 0 companionSource 2
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Expand Up @@ -65,6 +65,7 @@ set(testNames
)
set(modelNames
# StorageTank
AOSmithHPTS50
AOSmithPHPT60
AOSmithHPTU80
Sanden80
Expand Down
2 changes: 1 addition & 1 deletion test/main.cc
Expand Up @@ -333,7 +333,7 @@ int main(int argc, char *argv[])
allSchedules[1][i] *= (125. - allSchedules[0][i]) / (hpwh.getTankNodeTemp(hpwh.getNumNodes() - 1, HPWH::UNITS_F) - allSchedules[0][i]);
}
}
cout << i << std::endl;

// Run the step
hpwh.runOneStep(allSchedules[0][i], // Inlet water temperature (C)
GAL_TO_L(allSchedules[1][i]), // Flow in gallons
Expand Down

0 comments on commit cf6efe1

Please sign in to comment.