From 440288f5569ce4011695a5166bc6eae7edd30737 Mon Sep 17 00:00:00 2001 From: Phil Ahrenkiel Date: Wed, 14 Feb 2024 15:35:22 -0700 Subject: [PATCH] Initialize vars. --- src/HPWH.hh | 2 +- src/HPWHHeatSources.cc | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/HPWH.hh b/src/HPWH.hh index 4458440d..f400ac9c 100644 --- a/src/HPWH.hh +++ b/src/HPWH.hh @@ -1450,7 +1450,7 @@ class HPWH::HeatSource when the heat source is engaged, it is subtracted from lowT cutoffs and added to lowTreheat cutoffs */ - bool depressesTemperature; + bool depressesTemperature = false; /**< heat pumps can depress the temperature of their space in certain instances - whether or not this occurs is a bool in HPWH, but a heat source must know if it is capable of contributing to this effect or not diff --git a/src/HPWHHeatSources.cc b/src/HPWHHeatSources.cc index 88251de5..4c5afc74 100644 --- a/src/HPWHHeatSources.cc +++ b/src/HPWHHeatSources.cc @@ -36,6 +36,14 @@ HPWH::HeatSource::HeatSource(HPWH* parentInput) , secondaryHeatExchanger {0., 0., 0.} , heatRetentionCoef(0.) , energyRetained_kWh(0.) + , Tshrinkage_C(1.) + , energyInput_kWh(0.) + , energyOutput_kWh(0.) + , energyRemovedFromEnvironment_kWh(0.) + , runtime_min(0.) + , isVIP(false) + , lowestNode(0) + , configuration(CONFIG_SUBMERGED) { } @@ -56,6 +64,7 @@ HPWH::HeatSource& HPWH::HeatSource::operator=(const HeatSource& hSource) runtime_min = hSource.runtime_min; energyInput_kWh = hSource.energyInput_kWh; energyOutput_kWh = hSource.energyOutput_kWh; + energyRemovedFromEnvironment_kWh = hSource.energyRemovedFromEnvironment_kWh; isVIP = hSource.isVIP; @@ -150,7 +159,6 @@ void HPWH::HeatSource::unlockHeatSource() { lockedOut = false; } bool HPWH::HeatSource::shouldLockOut(double heatSourceAmbientT_C) const { - // if it's already locked out, keep it locked out if (isLockedOut() == true) { @@ -232,7 +240,6 @@ bool HPWH::HeatSource::shouldLockOut(double heatSourceAmbientT_C) const bool HPWH::HeatSource::shouldUnlock(double heatSourceAmbientT_C) const { - // if it's already unlocked, keep it unlocked if (isLockedOut() == false) { @@ -294,7 +301,6 @@ bool HPWH::HeatSource::shouldUnlock(double heatSourceAmbientT_C) const bool HPWH::HeatSource::toLockOrUnlock(double heatSourceAmbientT_C) { - if (shouldLockOut(heatSourceAmbientT_C)) { lockOutHeatSource(); @@ -607,7 +613,6 @@ void HPWH::HeatSource::sortPerformanceMap() double HPWH::HeatSource::getTankTemp() const { - std::vector resampledTankTemps(getCondensitySize()); resample(resampledTankTemps, hpwh->tankTemps_C); @@ -945,7 +950,6 @@ void HPWH::HeatSource::regressedMethodMP(double& ynew, void HPWH::HeatSource::btwxtInterp(double& input_BTUperHr, double& cop, std::vector& target) { - std::vector result = perfRGI->get_values_at_target(target); input_BTUperHr = result[0]; @@ -954,7 +958,6 @@ void HPWH::HeatSource::btwxtInterp(double& input_BTUperHr, double& cop, std::vec void HPWH::HeatSource::calcHeatDist(std::vector& heatDistribution) { - // Populate the vector of heat distribution switch (configuration) { @@ -1246,7 +1249,6 @@ void HPWH::HeatSource::setupAsResistiveElement(int node, double Watts, int condensitySize /* = CONDENSITY_SIZE*/) { - isOn = false; isVIP = false; condensity = std::vector(condensitySize, 0.);