Skip to content
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

BoilerHotWater: on cycle name change #4985

Merged
merged 6 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace energyplus {

// OnCycleParasiticElectricLoad

if ((value = modelObject.parasiticElectricLoad())) {
if ((value = modelObject.onCycleParasiticElectricLoad())) {
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved
idfObject.setDouble(Boiler_HotWaterFields::OnCycleParasiticElectricLoad, value.get());
}

Expand Down
2 changes: 1 addition & 1 deletion src/energyplus/Test/BoilerHotWater_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_BoilerHotWater) {
EXPECT_TRUE(bhw.setOptimumPartLoadRatio(6.0));
EXPECT_TRUE(bhw.setWaterOutletUpperTemperatureLimit(7.0));
EXPECT_TRUE(bhw.setBoilerFlowMode("LeavingSetpointModulated"));
EXPECT_TRUE(bhw.setParasiticElectricLoad(8.0));
EXPECT_TRUE(bhw.setOnCycleParasiticElectricLoad(8.0));
EXPECT_TRUE(bhw.setSizingFactor(9.0));
EXPECT_TRUE(bhw.setEndUseSubcategory("Test"));
EXPECT_TRUE(bhw.setOffCycleParasiticFuelLoad(10.0));
Expand Down
43 changes: 29 additions & 14 deletions src/model/BoilerHotWater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ namespace model {
return isEmpty(OS_Boiler_HotWaterFields::BoilerFlowMode);
}

boost::optional<double> BoilerHotWater_Impl::parasiticElectricLoad() const {
return getDouble(OS_Boiler_HotWaterFields::OnCycleParasiticElectricLoad, true);
double BoilerHotWater_Impl::onCycleParasiticElectricLoad() const {
boost::optional<double> value = getDouble(OS_Boiler_HotWaterFields::OnCycleParasiticElectricLoad, true);
OS_ASSERT(value);
return value.get();
}

double BoilerHotWater_Impl::sizingFactor() const {
Expand Down Expand Up @@ -347,17 +349,12 @@ namespace model {
OS_ASSERT(result);
}

bool BoilerHotWater_Impl::setParasiticElectricLoad(boost::optional<double> parasiticElectricLoad) {
bool result = false;
if (parasiticElectricLoad) {
result = setDouble(OS_Boiler_HotWaterFields::OnCycleParasiticElectricLoad, parasiticElectricLoad.get());
} else {
result = setString(OS_Boiler_HotWaterFields::OnCycleParasiticElectricLoad, "");
}
bool BoilerHotWater_Impl::setOnCycleParasiticElectricLoad(double onCycleParasiticElectricLoad) {
bool result = setDouble(OS_Boiler_HotWaterFields::OnCycleParasiticElectricLoad, onCycleParasiticElectricLoad);
jmarrec marked this conversation as resolved.
Show resolved Hide resolved
return result;
}

void BoilerHotWater_Impl::resetParasiticElectricLoad() {
void BoilerHotWater_Impl::resetOnCycleParasiticElectricLoad() {
bool result = setString(OS_Boiler_HotWaterFields::OnCycleParasiticElectricLoad, "");
OS_ASSERT(result);
}
Expand Down Expand Up @@ -478,7 +475,7 @@ namespace model {

setBoilerFlowMode("ConstantFlow");

setParasiticElectricLoad(0.0);
setOnCycleParasiticElectricLoad(0.0);
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved

setSizingFactor(1.0);

Expand Down Expand Up @@ -577,8 +574,14 @@ namespace model {
return getImpl<detail::BoilerHotWater_Impl>()->isBoilerFlowModeDefaulted();
}

// DEPRECATED
boost::optional<double> BoilerHotWater::parasiticElectricLoad() const {
return getImpl<detail::BoilerHotWater_Impl>()->parasiticElectricLoad();
DEPRECATED_AT_MSG(3, 7, 0, "Use onCycleParasiticElectricLoad instead.");
return getImpl<detail::BoilerHotWater_Impl>()->onCycleParasiticElectricLoad();
}

double BoilerHotWater::onCycleParasiticElectricLoad() const {
return getImpl<detail::BoilerHotWater_Impl>()->onCycleParasiticElectricLoad();
}

double BoilerHotWater::sizingFactor() const {
Expand Down Expand Up @@ -681,12 +684,24 @@ namespace model {
getImpl<detail::BoilerHotWater_Impl>()->resetBoilerFlowMode();
}

// DEPRECATED
bool BoilerHotWater::setParasiticElectricLoad(double parasiticElectricLoad) {
return getImpl<detail::BoilerHotWater_Impl>()->setParasiticElectricLoad(parasiticElectricLoad);
DEPRECATED_AT_MSG(3, 7, 0, "Use setOnCycleParasiticElectricLoad instead.");
return getImpl<detail::BoilerHotWater_Impl>()->setOnCycleParasiticElectricLoad(parasiticElectricLoad);
}

bool BoilerHotWater::setOnCycleParasiticElectricLoad(double onCycleParasiticElectricLoad) {
return getImpl<detail::BoilerHotWater_Impl>()->setOnCycleParasiticElectricLoad(onCycleParasiticElectricLoad);
}

// DEPRECATED
void BoilerHotWater::resetParasiticElectricLoad() {
getImpl<detail::BoilerHotWater_Impl>()->resetParasiticElectricLoad();
DEPRECATED_AT_MSG(3, 7, 0, "Use resetOnCycleParasiticElectricLoad instead.");
getImpl<detail::BoilerHotWater_Impl>()->resetOnCycleParasiticElectricLoad();
}

void BoilerHotWater::resetOnCycleParasiticElectricLoad() {
getImpl<detail::BoilerHotWater_Impl>()->resetOnCycleParasiticElectricLoad();
}

bool BoilerHotWater::setSizingFactor(double sizingFactor) {
Expand Down
13 changes: 10 additions & 3 deletions src/model/BoilerHotWater.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "ModelAPI.hpp"
#include "StraightComponent.hpp"
#include "../utilities/core/Deprecated.hpp"

namespace openstudio {

Expand Down Expand Up @@ -87,7 +88,9 @@ namespace model {

bool isBoilerFlowModeDefaulted() const;

boost::optional<double> parasiticElectricLoad() const;
OS_DEPRECATED(3, 7, 0) boost::optional<double> parasiticElectricLoad() const;

double onCycleParasiticElectricLoad() const;

double sizingFactor() const;

Expand Down Expand Up @@ -145,9 +148,13 @@ namespace model {

void resetBoilerFlowMode();

bool setParasiticElectricLoad(double parasiticElectricLoad);
OS_DEPRECATED(3, 7, 0) bool setParasiticElectricLoad(double parasiticElectricLoad);

bool setOnCycleParasiticElectricLoad(double onCyclearasiticElectricLoad);

OS_DEPRECATED(3, 7, 0) void resetParasiticElectricLoad();

void resetParasiticElectricLoad();
void resetOnCycleParasiticElectricLoad();

bool setSizingFactor(double sizingFactor);

Expand Down
4 changes: 2 additions & 2 deletions src/model/BoilerHotWater_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace model {

bool isBoilerFlowModeDefaulted() const;

boost::optional<double> parasiticElectricLoad() const;
double onCycleParasiticElectricLoad() const;

double sizingFactor() const;

Expand Down Expand Up @@ -160,7 +160,7 @@ namespace model {

void resetBoilerFlowMode();

bool setParasiticElectricLoad(boost::optional<double> parasiticElectricLoad);
bool setOnCycleParasiticElectricLoad(double onCycleParasiticElectricLoad);

void resetParasiticElectricLoad();

Expand Down
8 changes: 3 additions & 5 deletions src/model/test/BoilerHotWater_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ TEST_F(ModelFixture, BoilerHotWater_BoilerHotWater) {
Model m;
BoilerHotWater boiler(m);

ASSERT_TRUE(boiler.parasiticElectricLoad());
EXPECT_EQ(0.0, boiler.parasiticElectricLoad().get());
EXPECT_EQ(0.0, boiler.onCycleParasiticElectricLoad());
EXPECT_EQ(0.0, boiler.offCycleParasiticFuelLoad());

EXPECT_TRUE(boiler.setParasiticElectricLoad(0.5));
ASSERT_TRUE(boiler.parasiticElectricLoad());
EXPECT_EQ(0.5, boiler.parasiticElectricLoad().get());
EXPECT_TRUE(boiler.setOnCycleParasiticElectricLoad(0.5));
EXPECT_EQ(0.5, boiler.onCycleParasiticElectricLoad());

EXPECT_TRUE(boiler.setOffCycleParasiticFuelLoad(0.8));
EXPECT_EQ(0.8, boiler.offCycleParasiticFuelLoad());
Expand Down