diff --git a/src/HPWH.cc b/src/HPWH.cc index 26ad0e4d..0ff42d88 100644 --- a/src/HPWH.cc +++ b/src/HPWH.cc @@ -177,16 +177,6 @@ HPWH::HPWH(): tankTemps_C(NULL),nextTankTemps_C(NULL),messageCallback(NULL),mess setAllDefaults(); }; - -void HPWH::addHeatSources(const std::size_t numHeatSources) -{ - setOfSources.resize(numHeatSources); - for (std::size_t i = 0; i< numHeatSources; ++i) - { - setOfSources[i].hpwh = this; - } -} - void HPWH::setAllDefaults() { tankTemps_C.clear(); nextTankTemps_C.clear(); @@ -206,59 +196,7 @@ void HPWH::setAllDefaults() { } HPWH::HPWH(const HPWH &hpwh) { - simHasFailed = hpwh.simHasFailed; - - hpwhVerbosity = hpwh.hpwhVerbosity; - - //these should actually be the same pointers - messageCallback = hpwh.messageCallback; - messageCallbackContextPtr = hpwh.messageCallbackContextPtr; - - isHeating = hpwh.isHeating; - - setOfSources = hpwh.setOfSources; - for(int i = 0; i < getNumHeatSources(); i++) { - setOfSources[i].hpwh = this; - } - - tankVolume_L = hpwh.tankVolume_L; - tankUA_kJperHrC = hpwh.tankUA_kJperHrC; - fittingsUA_kJperHrC = hpwh.fittingsUA_kJperHrC; - - setpoint_C = hpwh.setpoint_C; - nodeDensity = hpwh.nodeDensity; - tankTemps_C = hpwh.tankTemps_C; - nextTankTemps_C = hpwh.nextTankTemps_C; - - inletHeight = hpwh.inletHeight; - inlet2Height = hpwh.inlet2Height; - - outletTemp_C = hpwh.outletTemp_C; - condenserInlet_C = hpwh.condenserInlet_C; - condenserOutlet_C = hpwh.condenserOutlet_C; - externalVolumeHeated_L = hpwh.externalVolumeHeated_L; - energyRemovedFromEnvironment_kWh = hpwh.energyRemovedFromEnvironment_kWh; - standbyLosses_kWh = hpwh.standbyLosses_kWh; - - tankMixesOnDraw = hpwh.tankMixesOnDraw; - mixBelowFractionOnDraw = hpwh.mixBelowFractionOnDraw; - doTempDepression = hpwh.doTempDepression; - - doInversionMixing = hpwh.doInversionMixing; - doConduction = hpwh.doConduction; - - locationTemperature_C = hpwh.locationTemperature_C; - - prevDRstatus = hpwh.prevDRstatus; - timerLimitTOT = hpwh.timerLimitTOT; - - usesSoCLogic = hpwh.usesSoCLogic; - - nodeVolume_L = hpwh.nodeVolume_L; - nodeHeight_m = hpwh.nodeHeight_m; - fracAreaTop = hpwh.fracAreaTop; - fracAreaSide = hpwh.fracAreaSide; - + *this = hpwh; } HPWH & HPWH::operator=(const HPWH &hpwh) { @@ -332,6 +270,11 @@ HPWH & HPWH::operator=(const HPWH &hpwh) { HPWH::~HPWH() { } +HPWH::HeatSource &HPWH::addHeatSource() +{ + return setOfSources.emplace_back(this); +} + string HPWH::getVersion() { std::stringstream version; diff --git a/src/HPWH.in.hh b/src/HPWH.in.hh index 3e076342..eddaa324 100644 --- a/src/HPWH.in.hh +++ b/src/HPWH.in.hh @@ -803,7 +803,7 @@ private: class HeatSource; void setAllDefaults(); /**< sets all the defaults default */ - void addHeatSources(const std::size_t numHeatSources); + HeatSource &addHeatSource(); void updateTankTemps(double draw,double inletT,double ambientT,double inletVol2_L,double inletT2_L); void mixTankInversions(); diff --git a/src/HPWHpresets.cc b/src/HPWHpresets.cc index b9862f78..517ae220 100644 --- a/src/HPWHpresets.cc +++ b/src/HPWHpresets.cc @@ -17,6 +17,8 @@ int HPWH::HPWHinit_resTank(double tankVol_L, double energyFactor, double upperPo // sets simHasFailed = true; this gets cleared on successful completion of init // return 0 on success, HPWH_ABORT for failure + setOfSources.clear(); + //low power element will cause divide by zero/negative UA in EF -> UA conversion if (lowerPower_W < 550) { if (hpwhVerbosity >= VRB_reluctant) { @@ -53,7 +55,6 @@ int HPWH::HPWHinit_resTank(double tankVol_L, double energyFactor, double upperPo doTempDepression = false; tankMixesOnDraw = true; - HeatSource resistiveElementBottom(this); resistiveElementBottom.setupAsResistiveElement(0, lowerPower_W); @@ -70,16 +71,15 @@ int HPWH::HPWHinit_resTank(double tankVol_L, double energyFactor, double upperPo resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(20))); resistiveElementTop.isVIP = true; - setOfSources = std::vector(2); - // set everything in it's correct place + setOfSources.resize(2); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[0].followedByHeatSource = &setOfSources[1]; } else { - setOfSources = std::vector(1); + setOfSources.resize(1); setOfSources[0] = resistiveElementBottom; } @@ -133,6 +133,7 @@ int HPWH::HPWHinit_resTankGeneric(double tankVol_L, double rValue_M2KperW, doubl setAllDefaults(); // reset all defaults if you're re-initilizing // sets simHasFailed = true; this gets cleared on successful completion of init // return 0 on success, HPWH_ABORT for failure + setOfSources.clear(); //low power element will cause divide by zero/negative UA in EF -> UA conversion if (lowerPower_W < 0) { @@ -168,12 +169,6 @@ int HPWH::HPWHinit_resTankGeneric(double tankVol_L, double rValue_M2KperW, doubl doTempDepression = false; tankMixesOnDraw = true; - // Count up heat sources - std::size_t numHeatSources = 0; - numHeatSources += upperPower_W > 0. ? 1 : 0; - numHeatSources += lowerPower_W > 0. ? 1 : 0; - setOfSources = std::vector(numHeatSources); - // Deal with upper element if (upperPower_W > 0.) { // Only add an upper element when the upperPower_W > 0 otherwise ignore this. @@ -184,7 +179,7 @@ int HPWH::HPWHinit_resTankGeneric(double tankVol_L, double rValue_M2KperW, doubl resistiveElementTop.isVIP = true; // Upper should always be first in setOfSources if it exists. - setOfSources[0] = resistiveElementTop; + setOfSources.push_back(resistiveElementTop); } // Deal with bottom element @@ -196,13 +191,11 @@ int HPWH::HPWHinit_resTankGeneric(double tankVol_L, double rValue_M2KperW, doubl resistiveElementBottom.addTurnOnLogic(HPWH::standby(dF_TO_dC(10.))); // set everything in it's correct place - if (numHeatSources == 1) {// if one only one slot - setOfSources[0] = resistiveElementBottom; - } - else if (numHeatSources == 2) { // if two upper already exists - setOfSources[1] = resistiveElementBottom; - setOfSources[0].followedByHeatSource = &setOfSources[1]; - } + setOfSources.push_back(resistiveElementBottom); + } + + if (getNumHeatSources() == 2) { + setOfSources[0].followedByHeatSource = &setOfSources[1]; } // Calc UA @@ -225,15 +218,15 @@ int HPWH::HPWHinit_resTankGeneric(double tankVol_L, double rValue_M2KperW, doubl if (checkInputs() == HPWH_ABORT) return HPWH_ABORT; isHeating = false; - for (int i = 0; i < numHeatSources; i++) { - if (setOfSources[i].isOn) { + for (auto &source: setOfSources) { + if (source.isOn) { isHeating = true; } - setOfSources[i].sortPerformanceMap(); + source.sortPerformanceMap(); } if (hpwhVerbosity >= VRB_emetic) { - for (int i = 0; i < numHeatSources; i++) { + for (int i = 0; i < getNumHeatSources(); i++) { msg("heat source %d: %p \n", i, &setOfSources[i]); } msg("\n\n"); @@ -248,6 +241,7 @@ int HPWH::HPWHinit_genericHPWH(double tankVol_L, double energyFactor, double res setAllDefaults(); // reset all defaults if you're re-initilizing // sets simHasFailed = true; this gets cleared on successful completion of init // return 0 on success, HPWH_ABORT for failure + setOfSources.clear(); //except where noted, these values are taken from MODELS_GE2014STDMode on 5/17/16 setNumNodes(12); @@ -265,8 +259,6 @@ int HPWH::HPWHinit_genericHPWH(double tankVol_L, double energyFactor, double res doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -320,13 +312,9 @@ int HPWH::HPWHinit_genericHPWH(double tankVol_L, double energyFactor, double res //custom adjustment for poorer performance //compressor.addShutOffLogic(HPWH::lowT(F_TO_C(37))); - - + // //end section of parameters from GE model - - - //set tank volume from input //use tank size setting function since it has bounds checking int failure = this->setTankSize(tankVol_L); @@ -337,16 +325,12 @@ int HPWH::HPWHinit_genericHPWH(double tankVol_L, double energyFactor, double res return failure; } - // derive conservative (high) UA from tank volume // curve fit by Jim Lutz, 5-25-2016 double tankVol_gal = tankVol_L / GAL_TO_L(1.); double v1 = 7.5156316175 * pow(tankVol_gal, 0.33) + 5.9995357658; tankUA_kJperHrC = 0.0076183819 * v1 * v1; - - - //do a linear interpolation to scale COP curve constant, using measured values // Chip's attempt 24-May-2014 double uefSpan = 3.4 - 2.0; @@ -372,7 +356,8 @@ int HPWH::HPWHinit_genericHPWH(double tankVol_L, double energyFactor, double res compressor.perfMap[1].inputPower_coeffs[1] /= genericFudge; compressor.perfMap[1].inputPower_coeffs[2] /= genericFudge; - //set everything in its places + //set everything in its place + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -385,8 +370,6 @@ int HPWH::HPWHinit_genericHPWH(double tankVol_L, double energyFactor, double res setOfSources[0].followedByHeatSource = &setOfSources[1]; setOfSources[1].followedByHeatSource = &setOfSources[2]; - - //standard finishing up init, borrowed from init function hpwhModel = MODELS_genericCustomUEF; @@ -425,6 +408,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { // sets simHasFailed = true; this gets cleared on successful completion of init // return 0 on success, HPWH_ABORT for failure + setOfSources.clear(); + //resistive with no UA losses for testing if (presetNum == MODELS_restankNoUA) { setNumNodes(12); @@ -434,14 +419,12 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { tankVolume_L = GAL_TO_L(50); tankUA_kJperHrC = 0; //0 to turn off - doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(2); - HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); + resistiveElementBottom.setupAsResistiveElement(0, 4500); resistiveElementTop.setupAsResistiveElement(8, 4500); @@ -453,6 +436,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.isVIP = true; //assign heat sources into array in order of priority + //set everything in its places + setOfSources.resize(2); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; @@ -471,8 +456,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(2); - //set up a resistive element at the bottom, 4500 kW HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -487,13 +470,12 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(20)); resistiveElementTop.isVIP = true; - //assign heat sources into array in order of priority + setOfSources.resize(2); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[0].followedByHeatSource = &setOfSources[1]; - } //realistic resistive tank @@ -509,10 +491,9 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { //should eventually put tankmixes to true when testing progresses tankMixesOnDraw = false; - setOfSources = std::vector(2); - HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); + resistiveElementBottom.setupAsResistiveElement(0, 4500); resistiveElementTop.setupAsResistiveElement(9, 4500); @@ -523,6 +504,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(20)); resistiveElementTop.isVIP = true; + //set everything in its place + setOfSources.resize(2); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; @@ -542,9 +525,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - //////////////////////////////////////////////////// - setOfSources = std::vector(1); - HeatSource extra(this); //compressor values @@ -558,6 +538,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { //initial guess, will get reset based on the input heat vector extra.setCondensity(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + //set everything in its places + setOfSources.resize(1); setOfSources[0] = extra; } @@ -574,8 +556,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(3); - HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); HeatSource compressor(this); @@ -592,7 +572,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(20)); resistiveElementTop.isVIP = true; - compressor.isOn = false; compressor.isVIP = false; compressor.typeOfHeatSource = TYPE_compressor; @@ -624,7 +603,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { compressor.addTurnOnLogic(HPWH::bottomThird(20)); compressor.addTurnOnLogic(HPWH::standby(15)); - //set everything in its places + //set everything in its place + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = compressor; setOfSources[2] = resistiveElementBottom; @@ -652,8 +632,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(1); - HeatSource compressor(this); compressor.isOn = false; @@ -689,8 +667,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { //lowT cutoff compressor.addShutOffLogic(HPWH::bottomNodeMaxTemp(20, true)); - //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } //voltex 60 gallon @@ -704,8 +682,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -757,8 +733,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(25.0))); - //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = compressor; setOfSources[2] = resistiveElementBottom; @@ -782,8 +758,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -836,8 +810,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(25.0))); - //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = compressor; setOfSources[2] = resistiveElementBottom; @@ -861,8 +835,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -920,8 +892,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { // resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(31.0))); resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(28.0))); - //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = compressor; setOfSources[2] = resistiveElementBottom; @@ -933,7 +905,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { setOfSources[0].followedByHeatSource = &setOfSources[1]; setOfSources[1].followedByHeatSource = &setOfSources[2]; - } // If a Colmac single pass preset cold weather or not else if (MODELS_ColmacCxV_5_SP <= presetNum && presetNum <= MODELS_ColmacCxA_30_SP) { @@ -947,9 +918,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { tankVolume_L = 315; // Gets adjust per model but ratio between vol and UA is important tankUA_kJperHrC = 7; - setOfSources = std::vector(1); - HeatSource compressor(this); + compressor.isOn = false; compressor.isVIP = true; compressor.typeOfHeatSource = TYPE_compressor; @@ -1070,6 +1040,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { } //End if MODELS_ColmacCxV_5_SP //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } @@ -1086,9 +1057,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { tankVolume_L = 315; // Gets adjust per model but ratio between vol and UA is important tankUA_kJperHrC = 7; - setOfSources = std::vector(1); - HeatSource compressor(this); + compressor.isOn = false; compressor.isVIP = true; compressor.typeOfHeatSource = TYPE_compressor; @@ -1199,6 +1169,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { } //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } // If Nyle single pass preset @@ -1213,10 +1184,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(1); - HeatSource compressor(this); - //HeatSource resistiveElement(this); compressor.isOn = false; compressor.isVIP = true; @@ -1334,6 +1302,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { } //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } @@ -1349,9 +1318,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { tankVolume_L = 315; // Gets adjust per model but ratio between vol and UA is important tankUA_kJperHrC = 7; - setOfSources = std::vector(1); - HeatSource compressor(this); + compressor.isOn = false; compressor.isVIP = true; compressor.typeOfHeatSource = TYPE_compressor; @@ -1501,6 +1469,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { compressor.useBtwxtGrid = true; //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } // if rheem multipass @@ -1515,9 +1484,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { tankVolume_L = 315; // Gets adjust per model but ratio between vol and UA is important tankUA_kJperHrC = 7; - setOfSources = std::vector(1); - HeatSource compressor(this); + compressor.isOn = false; compressor.isVIP = true; compressor.typeOfHeatSource = TYPE_compressor; @@ -1570,6 +1538,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { } //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } @@ -1584,8 +1553,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(1); - HeatSource compressor(this); compressor.isOn = false; @@ -1704,8 +1671,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { compressor.secondaryHeatExchanger = { dF_TO_dC(10.), dF_TO_dC(15.), 27. }; //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; - } else if (presetNum == MODELS_SANCO2_83 || presetNum == MODELS_SANCO2_GS3_45HPA_US_SP || presetNum == MODELS_SANCO2_119) { @@ -1728,8 +1695,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(1); - HeatSource compressor(this); compressor.isOn = false; @@ -1794,7 +1759,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { std::greater(), true)); compressor.depressesTemperature = false; //no temp depression - //set everything in its places + //set everything in its place + setOfSources.resize(1); setOfSources[0] = compressor; } else if (presetNum == MODELS_SANCO2_43) { @@ -1809,8 +1775,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(1); - HeatSource compressor(this); compressor.isOn = false; @@ -1874,7 +1838,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { std::greater(), true)); compressor.depressesTemperature = false; //no temp depression - //set everything in its places + //set everything in its place + setOfSources.resize(1); setOfSources[0] = compressor; } else if (presetNum == MODELS_AOSmithHPTU50 || presetNum == MODELS_RheemHBDR2250 || presetNum == MODELS_RheemHBDR4550) { @@ -1887,8 +1852,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -1960,6 +1923,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { // resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(28))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -1991,8 +1955,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2063,8 +2025,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(std::make_shared("top sixth absolute", nodeWeights, F_TO_C(105), this, true)); // resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(31))); - - //set everything in its places + //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -2090,8 +2052,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2162,8 +2122,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(std::make_shared("top sixth absolute", nodeWeights, F_TO_C(105), this, true)); // resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(35))); - - //set everything in its places + //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -2189,8 +2149,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2243,8 +2201,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { // resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(39.9691))); resistiveElementTop.addTurnOnLogic(HPWH::topThird_absolute(F_TO_C(87))); - //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -2259,94 +2217,93 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { } else if (presetNum == MODELS_AOSmithCAHP120) { - setNumNodes(24); - setpoint_C = F_TO_C(150.0); - - tankVolume_L = GAL_TO_L(111.76); // AOSmith docs say 111.76 - tankUA_kJperHrC = UAf_TO_UAc(3.94); + setNumNodes(24); + setpoint_C = F_TO_C(150.0); - doTempDepression = false; - tankMixesOnDraw = false; + tankVolume_L = GAL_TO_L(111.76); // AOSmith docs say 111.76 + tankUA_kJperHrC = UAf_TO_UAc(3.94); - setOfSources = std::vector(3); + doTempDepression = false; + tankMixesOnDraw = false; - HeatSource compressor(this); - HeatSource resistiveElementBottom(this); - HeatSource resistiveElementTop(this); + HeatSource compressor(this); + HeatSource resistiveElementBottom(this); + HeatSource resistiveElementTop(this); - //compressor values - compressor.isOn = false; - compressor.isVIP = false; - compressor.typeOfHeatSource = TYPE_compressor; - compressor.setCondensity(0.3, 0.3, 0.2, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + //compressor values + compressor.isOn = false; + compressor.isVIP = false; + compressor.typeOfHeatSource = TYPE_compressor; + compressor.setCondensity(0.3, 0.3, 0.2, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - //From CAHP 120 COP Tests - compressor.perfMap.reserve(3); + //From CAHP 120 COP Tests + compressor.perfMap.reserve(3); - // Tuned on the multiple K167 tests - compressor.perfMap.push_back({ - 50., // Temperature (T_F) - {2010.49966, -4.20966, 0.085395}, // Input Power Coefficients (inputPower_coeffs) - {5.91, -0.026299, 0.0} // COP Coefficients (COP_coeffs) - }); - - compressor.perfMap.push_back({ - 67.5, // Temperature (T_F) - {2171.012, -6.936571, 0.1094962}, // Input Power Coefficients (inputPower_coeffs) - {7.26272, -0.034135, 0.0} // COP Coefficients (COP_coeffs) - }); + // Tuned on the multiple K167 tests + compressor.perfMap.push_back({ + 50., // Temperature (T_F) + {2010.49966, -4.20966, 0.085395}, // Input Power Coefficients (inputPower_coeffs) + {5.91, -0.026299, 0.0} // COP Coefficients (COP_coeffs) + }); - compressor.perfMap.push_back({ - 95., // Temperature (T_F) - {2276.0625, -7.106608, 0.119911}, // Input Power Coefficients (inputPower_coeffs) - {8.821262, -0.042059, 0.0} // COP Coefficients (COP_coeffs) - }); + compressor.perfMap.push_back({ + 67.5, // Temperature (T_F) + {2171.012, -6.936571, 0.1094962}, // Input Power Coefficients (inputPower_coeffs) + {7.26272, -0.034135, 0.0} // COP Coefficients (COP_coeffs) + }); - compressor.minT = F_TO_C(47.0); //Product documentation says 45F doesn't look like it in CMP-T test// - compressor.maxT = F_TO_C(110.0); - compressor.hysteresis_dC = dF_TO_dC(2); - compressor.configuration = HeatSource::CONFIG_WRAPPED; - compressor.maxSetpoint_C = MAXOUTLET_R134A; + compressor.perfMap.push_back({ + 95., // Temperature (T_F) + {2276.0625, -7.106608, 0.119911}, // Input Power Coefficients (inputPower_coeffs) + {8.821262, -0.042059, 0.0} // COP Coefficients (COP_coeffs) + }); - //top resistor values - double wattRE = 6000;//5650.; - resistiveElementTop.setupAsResistiveElement(7, wattRE); - resistiveElementTop.isVIP = true; // VIP is the only source that turns on independently when something else is already heating. + compressor.minT = F_TO_C(47.0); //Product documentation says 45F doesn't look like it in CMP-T test// + compressor.maxT = F_TO_C(110.0); + compressor.hysteresis_dC = dF_TO_dC(2); + compressor.configuration = HeatSource::CONFIG_WRAPPED; + compressor.maxSetpoint_C = MAXOUTLET_R134A; - //bottom resistor values - resistiveElementBottom.setupAsResistiveElement(0, wattRE); - resistiveElementBottom.hysteresis_dC = dF_TO_dC(2); - resistiveElementBottom.setCondensity(0.2, 0.8, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.); // Based of CMP test + //top resistor values + double wattRE = 6000;//5650.; + resistiveElementTop.setupAsResistiveElement(7, wattRE); + resistiveElementTop.isVIP = true; // VIP is the only source that turns on independently when something else is already heating. - //logic conditions for - double compStart = dF_TO_dC(5.25); - double standbyT = dF_TO_dC(5.); //Given CMP_T test - compressor.addTurnOnLogic(HPWH::secondSixth(compStart)); - compressor.addTurnOnLogic(HPWH::standby(standbyT)); + //bottom resistor values + resistiveElementBottom.setupAsResistiveElement(0, wattRE); + resistiveElementBottom.hysteresis_dC = dF_TO_dC(2); + resistiveElementBottom.setCondensity(0.2, 0.8, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.); // Based of CMP test + + //logic conditions for + double compStart = dF_TO_dC(5.25); + double standbyT = dF_TO_dC(5.); //Given CMP_T test + compressor.addTurnOnLogic(HPWH::secondSixth(compStart)); + compressor.addTurnOnLogic(HPWH::standby(standbyT)); - double resistanceStart = 12.; - resistiveElementTop.addTurnOnLogic(HPWH::topThird(resistanceStart)); - resistiveElementBottom.addTurnOnLogic(HPWH::topThird(resistanceStart)); + double resistanceStart = 12.; + resistiveElementTop.addTurnOnLogic(HPWH::topThird(resistanceStart)); + resistiveElementBottom.addTurnOnLogic(HPWH::topThird(resistanceStart)); - resistiveElementTop.addShutOffLogic(HPWH::fifthSixthMaxTemp(F_TO_C(117.))); - resistiveElementBottom.addShutOffLogic(HPWH::secondSixthMaxTemp(F_TO_C(109.))); + resistiveElementTop.addShutOffLogic(HPWH::fifthSixthMaxTemp(F_TO_C(117.))); + resistiveElementBottom.addShutOffLogic(HPWH::secondSixthMaxTemp(F_TO_C(109.))); - //set everything in its places - setOfSources[0] = resistiveElementTop; - setOfSources[1] = resistiveElementBottom; - setOfSources[2] = compressor; + //set everything in its places + setOfSources.resize(3); + 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]; + //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[1]; - setOfSources[1].followedByHeatSource = &setOfSources[2]; - //setOfSources[2].followedByHeatSource = &setOfSources[1];; + setOfSources[0].followedByHeatSource = &setOfSources[1]; + setOfSources[1].followedByHeatSource = &setOfSources[2]; + //setOfSources[2].followedByHeatSource = &setOfSources[1];; - setOfSources[0].companionHeatSource = &setOfSources[1]; - setOfSources[1].companionHeatSource = &setOfSources[2]; + setOfSources[0].companionHeatSource = &setOfSources[1]; + setOfSources[1].companionHeatSource = &setOfSources[2]; } else if (MODELS_AOSmithHPTS50 <= presetNum && presetNum <= MODELS_AOSmithHPTS80) @@ -2369,8 +2326,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementTop(this); HeatSource resistiveElementBottom(this); @@ -2422,6 +2377,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(11.87))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -2447,8 +2403,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2500,6 +2454,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { // compressor.addShutOffLogic(HPWH::largeDraw(F_TO_C(65))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -2523,8 +2478,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2572,6 +2525,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { compressor.maxSetpoint_C = MAXOUTLET_R134A; //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -2595,8 +2549,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2651,11 +2603,11 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementBottom.addShutOffLogic(HPWH::bottomTwelthMaxTemp(F_TO_C(80))); //set everything in its places + setOfSources.resize(3); 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]; @@ -2675,8 +2627,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2731,11 +2681,11 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementBottom.addShutOffLogic(HPWH::bottomTwelthMaxTemp(F_TO_C(80))); //set everything in its places + setOfSources.resize(3); 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]; @@ -2755,8 +2705,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2812,11 +2760,11 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { // resistiveElementBottom.addShutOffLogic(HPWH::bottomTwelthMaxTemp(F_TO_C(80))); //set everything in its places + setOfSources.resize(3); 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]; @@ -2837,8 +2785,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2893,11 +2839,11 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementBottom.addShutOffLogic(HPWH::bottomTwelthMaxTemp(F_TO_C(80))); //set everything in its places + setOfSources.resize(3); 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]; @@ -2929,8 +2875,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -2980,6 +2924,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topSixth(dF_TO_dC(20.4167))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3020,8 +2965,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -3070,8 +3013,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementBottom.addShutOffLogic(HPWH::bottomTwelthMaxTemp(F_TO_C(100))); resistiveElementTop.addTurnOnLogic(HPWH::topSixth(dF_TO_dC(20.4167))); - //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3113,7 +3056,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(1); HeatSource compressor(this); //compressor values @@ -3147,7 +3089,9 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { double standbyT = dF_TO_dC(9); compressor.addTurnOnLogic(HPWH::bottomThird(compStart)); compressor.addTurnOnLogic(HPWH::standby(standbyT)); + //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } else if (presetNum == MODELS_RheemPlugInDedicated40 || presetNum == MODELS_RheemPlugInDedicated50) { @@ -3164,7 +3108,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(1); HeatSource compressor(this); //compressor values @@ -3193,13 +3136,14 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { compressor.configuration = HPWH::HeatSource::CONFIG_WRAPPED; - //logic conditions double compStart = dF_TO_dC(20); double standbyT = dF_TO_dC(9); compressor.addTurnOnLogic(HPWH::bottomThird(compStart)); compressor.addTurnOnLogic(HPWH::standby(standbyT)); + //set everything in its places + setOfSources.resize(1); setOfSources[0] = compressor; } else if (presetNum == MODELS_RheemHB50) { @@ -3212,8 +3156,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -3266,8 +3208,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topSixth(dF_TO_dC(20.4167))); - //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3292,8 +3234,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = false; - setOfSources = std::vector(2); - HeatSource compressor(this); HeatSource resistiveElement(this); @@ -3332,6 +3272,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { compressor.depressesTemperature = false; //no temp depression //set everything in its places + setOfSources.resize(2); setOfSources[0] = compressor; setOfSources[1] = resistiveElement; @@ -3349,8 +3290,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -3401,6 +3340,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(35))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3421,8 +3361,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - HeatSource compressor(this); HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); @@ -3475,6 +3413,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(40))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3498,11 +3437,10 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - + //set everything in its places + HeatSource resistiveElementTop(this); HeatSource compressor(this); HeatSource resistiveElementBottom(this); - HeatSource resistiveElementTop(this); //compressor values compressor.isOn = false; @@ -3552,9 +3490,10 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.addTurnOnLogic(HPWH::topThird(dF_TO_dC(40))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; - setOfSources[1] = compressor; - setOfSources[2] = resistiveElementBottom; + 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 @@ -3575,11 +3514,9 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - - HeatSource compressor(this); - HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); + HeatSource resistiveElementBottom(this); + HeatSource compressor(this); //compressor values compressor.isOn = false; @@ -3627,6 +3564,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { compressor.addTurnOnLogic(HPWH::standby(dF_TO_dC(12.392))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3670,11 +3608,9 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { doTempDepression = false; tankMixesOnDraw = true; - setOfSources = std::vector(3); - - HeatSource compressor(this); - HeatSource resistiveElementBottom(this); HeatSource resistiveElementTop(this); + HeatSource resistiveElementBottom(this); + HeatSource compressor(this); //compressor values compressor.isOn = false; @@ -3725,6 +3661,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementBottom.addShutOffLogic(HPWH::bottomTwelthMaxTemp(F_TO_C(80))); //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3751,9 +3688,10 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { tankUA_kJperHrC = 7; setTankSize_adjustUA(600., UNITS_GAL); - setOfSources = std::vector(3); - + HeatSource resistiveElementTop(this); + HeatSource resistiveElementBottom(this); HeatSource compressor(this); + compressor.isOn = false; compressor.isVIP = true; compressor.typeOfHeatSource = TYPE_compressor; @@ -3794,9 +3732,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { std::greater(), true)); compressor.depressesTemperature = false; //no temp depression - - HeatSource resistiveElementBottom(this); - HeatSource resistiveElementTop(this); resistiveElementBottom.setupAsResistiveElement(0, 30000); resistiveElementTop.setupAsResistiveElement(9, 30000); @@ -3806,6 +3741,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.isVIP = true; //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor; @@ -3832,8 +3768,8 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { tankVolume_L = 315; // Gets adjust per model but ratio between vol and UA is important tankUA_kJperHrC = 7; - setOfSources = std::vector(3); - + HeatSource resistiveElementTop(this); + HeatSource resistiveElementBottom(this); HeatSource compressor(this); compressor.isOn = false; compressor.isVIP = true; @@ -3874,8 +3810,6 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { }); - HeatSource resistiveElementBottom(this); - HeatSource resistiveElementTop(this); resistiveElementBottom.setupAsResistiveElement(0, 30000); resistiveElementTop.setupAsResistiveElement(9, 30000); @@ -3885,6 +3819,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { resistiveElementTop.isVIP = true; //set everything in its places + setOfSources.resize(3); setOfSources[0] = resistiveElementTop; setOfSources[1] = resistiveElementBottom; setOfSources[2] = compressor;