diff --git a/src/HPWHHeatSources.cc b/src/HPWHHeatSources.cc index c9bf065d..944163ca 100644 --- a/src/HPWHHeatSources.cc +++ b/src/HPWHHeatSources.cc @@ -383,7 +383,7 @@ void HPWH::HeatSource::addHeat(double externalT_C,double minutesToRun) { case CONFIG_SUBMERGED: case CONFIG_WRAPPED: { - static std::vector heatDistribution(hpwh->getNumNodes()); + std::vector heatDistribution(hpwh->getNumNodes()); //calcHeatDist takes care of the swooping for wrapped configurations calcHeatDist(heatDistribution); diff --git a/src/HPWHpresets.cc b/src/HPWHpresets.cc index fa77c748..c5ae25f9 100644 --- a/src/HPWHpresets.cc +++ b/src/HPWHpresets.cc @@ -39,6 +39,8 @@ int HPWH::HPWHinit_resTank(double tankVol_L, double energyFactor, double upperPo return HPWH_ABORT; } + setNumNodes(12); + //use tank size setting function since it has bounds checking tankSizeFixed = false; int failure = this->setTankSize(tankVol_L); @@ -46,7 +48,6 @@ int HPWH::HPWHinit_resTank(double tankVol_L, double energyFactor, double upperPo return failure; } - setNumNodes(12); setpoint_C = F_TO_C(127.0); //start tank off at setpoint @@ -155,6 +156,8 @@ int HPWH::HPWHinit_resTankGeneric(double tankVol_L, double rValue_M2KperW, doubl return HPWH_ABORT; } + setNumNodes(12); + //set tank size function has bounds checking tankSizeFixed = false; if (this->setTankSize(tankVol_L) == HPWH_ABORT) { @@ -162,7 +165,6 @@ int HPWH::HPWHinit_resTankGeneric(double tankVol_L, double rValue_M2KperW, doubl } canScale = true; - setNumNodes(12); setpoint_C = F_TO_C(127.0); resetTankToSetpoint(); //start tank off at setpoint