diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index e61ea1ba459..ce97742ecd7 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -20106,10 +20106,16 @@ OS:Coil:Heating:WaterToAirHeatPump:EquationFit, \required-field \type object-list \object-list QuadvariateFunctions - A8; \field Heating Power Consumption Curve Name + A8, \field Heating Power Consumption Curve Name \required-field \type object-list \object-list QuadvariateFunctions + A9; \field Part Load Fraction Correlation Curve + \note quadratic curve = a + b*PLR + c*PLR**2 + \note cubic curve = a + b*PLR + c*PLR**2 + d*PLR**3 + \note PLR = part load ratio (heat load/steady state capacity) + \type object-list + \object-list UnivariateFunctions OS:Coil:Heating:DX:MultiSpeed, \extensible:1 diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp index 2d796a8b2c9..70208ac336b 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp @@ -12,6 +12,8 @@ #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp" #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp" #include "../../model/CurveQuadLinear.hpp" +#include "../../model/Curve.hpp" +#include "../../model/Curve_Impl.hpp" #include "../../utilities/core/Logger.hpp" #include "../../utilities/core/Assert.hpp" @@ -124,6 +126,13 @@ namespace energyplus { } } + // Part Load Fraction Correlation Curve Name + if (auto optCurve = modelObject.partLoadFractionCorrelationCurve()) { + if (auto _curve = translateAndMapModelObject(optCurve.get())) { + idfObject.setString(Coil_Heating_WaterToAirHeatPump_EquationFitFields::PartLoadFractionCorrelationCurveName, _curve->name().get()); + } + } + return idfObject; } diff --git a/src/energyplus/Test/ZoneHVACWaterToAirHeatPump_GTest.cpp b/src/energyplus/Test/ZoneHVACWaterToAirHeatPump_GTest.cpp index 78eb5641dc7..91a3ea58e10 100644 --- a/src/energyplus/Test/ZoneHVACWaterToAirHeatPump_GTest.cpp +++ b/src/energyplus/Test/ZoneHVACWaterToAirHeatPump_GTest.cpp @@ -20,6 +20,7 @@ #include "../../model/PortList.hpp" #include "../../model/Node.hpp" #include "../../model/PlantLoop.hpp" +#include "../../model/CurveQuadratic.hpp" #include #include @@ -49,6 +50,8 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_ZoneHVACWaterToAirHeatPump) { sch.setName("HP AvailSch"); CoilHeatingWaterToAirHeatPumpEquationFit htg_coil(m); htg_coil.setName("HP HC"); + CurveQuadratic partLoadFractionCorrelationCurve(m); + htg_coil.setPartLoadFractionCorrelationCurve(partLoadFractionCorrelationCurve); CoilCoolingWaterToAirHeatPumpEquationFit clg_coil(m); clg_coil.setName("HP CC"); FanOnOff fan(m); @@ -294,6 +297,10 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_ZoneHVACWaterToAirHeatPump) { idf_heatingCoil.getTarget(Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingPowerConsumptionCurveName)); ASSERT_TRUE(woCurve2); EXPECT_EQ(woCurve2->iddObject().type(), IddObjectType::Curve_QuadLinear); + boost::optional woCurve3( + idf_heatingCoil.getTarget(Coil_Heating_WaterToAirHeatPump_EquationFitFields::PartLoadFractionCorrelationCurveName)); + ASSERT_TRUE(woCurve3); + EXPECT_EQ(woCurve3->iddObject().type(), IddObjectType::Curve_Quadratic); } { diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp index 4ab5cb074cf..12f4940c8b6 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp @@ -16,6 +16,8 @@ #include "Model.hpp" #include "CurveQuadLinear.hpp" #include "CurveQuadLinear_Impl.hpp" +#include "Curve.hpp" +#include "Curve_Impl.hpp" #include #include @@ -325,6 +327,22 @@ namespace model { return result; } + boost::optional CoilHeatingWaterToAirHeatPumpEquationFit_Impl::partLoadFractionCorrelationCurve() const { + return getObject().getModelObjectTarget( + OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::PartLoadFractionCorrelationCurve); + } + + bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setPartLoadFractionCorrelationCurve(const Curve& curve) { + bool result = setPointer(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::PartLoadFractionCorrelationCurve, curve.handle()); + OS_ASSERT(result); + return result; + } + + void CoilHeatingWaterToAirHeatPumpEquationFit_Impl::resetPartLoadFractionCorrelationCurve() { + bool result = setString(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::PartLoadFractionCorrelationCurve, ""); + OS_ASSERT(result); + } + boost::optional CoilHeatingWaterToAirHeatPumpEquationFit_Impl::autosizedRatedAirFlowRate() const { // EPLUS-SQL-INCONSISTENCY return getAutosizedValue("Design Size Rated Air Flow Rate", "m3/s", "COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT"); @@ -740,6 +758,18 @@ namespace model { return curve.setCoefficient5z(heatingPowerConsumptionCoefficient5); } + boost::optional CoilHeatingWaterToAirHeatPumpEquationFit::partLoadFractionCorrelationCurve() const { + return getImpl()->partLoadFractionCorrelationCurve(); + } + + bool CoilHeatingWaterToAirHeatPumpEquationFit::setPartLoadFractionCorrelationCurve(const Curve& curve) { + return getImpl()->setPartLoadFractionCorrelationCurve(curve); + } + + void CoilHeatingWaterToAirHeatPumpEquationFit::resetPartLoadFractionCorrelationCurve() { + getImpl()->resetPartLoadFractionCorrelationCurve(); + } + /// @endcond } // namespace model diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp index 2b497d34190..77c0e151b17 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp @@ -16,6 +16,7 @@ namespace openstudio { namespace model { class CurveQuadLinear; + class Curve; namespace detail { @@ -94,6 +95,8 @@ namespace model { OS_DEPRECATED(3, 2, 0) double heatingPowerConsumptionCoefficient4() const; OS_DEPRECATED(3, 2, 0) double heatingPowerConsumptionCoefficient5() const; + boost::optional partLoadFractionCorrelationCurve() const; + //@} /** @name Setters */ //@{ @@ -148,6 +151,10 @@ namespace model { OS_DEPRECATED(3, 2, 0) bool setHeatingPowerConsumptionCoefficient4(double heatingPowerConsumptionCoefficient4); OS_DEPRECATED(3, 2, 0) bool setHeatingPowerConsumptionCoefficient5(double heatingPowerConsumptionCoefficient5); + bool setPartLoadFractionCorrelationCurve(const Curve& curve); + + void resetPartLoadFractionCorrelationCurve(); + //@} /** @name Other */ //@{ diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp index e3a9eaf65ca..504fd896150 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp @@ -13,6 +13,7 @@ namespace openstudio { namespace model { class CurveQuadLinear; + class Curve; namespace detail { @@ -91,6 +92,8 @@ namespace model { CurveQuadLinear heatingPowerConsumptionCurve() const; + boost::optional partLoadFractionCorrelationCurve() const; + boost::optional autosizedRatedAirFlowRate() const; boost::optional autosizedRatedWaterFlowRate() const; @@ -143,6 +146,10 @@ namespace model { bool setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve); + bool setPartLoadFractionCorrelationCurve(const Curve& curve); + + void resetPartLoadFractionCorrelationCurve(); + //@} /** @name Other */ //@{ diff --git a/src/model/test/CoilHeatingWaterToAirHeatPumpEquationFit_GTest.cpp b/src/model/test/CoilHeatingWaterToAirHeatPumpEquationFit_GTest.cpp index 80b9a825590..9c7fea70d47 100644 --- a/src/model/test/CoilHeatingWaterToAirHeatPumpEquationFit_GTest.cpp +++ b/src/model/test/CoilHeatingWaterToAirHeatPumpEquationFit_GTest.cpp @@ -9,6 +9,8 @@ #include "../CoilHeatingWaterToAirHeatPumpEquationFit.hpp" #include "../CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp" +#include "../CurveQuadratic.hpp" +#include "../CurveQuadratic_Impl.hpp" using namespace openstudio; using namespace openstudio::model; @@ -79,4 +81,12 @@ TEST_F(ModelFixture, CoilHeatingWaterToAirHeatPumpEquationFit_Test) { EXPECT_EQ(1.0, coilHeatingWaterToAirHPEquationFit.ratioofRatedHeatingCapacitytoRatedCoolingCapacity()); EXPECT_TRUE(coilHeatingWaterToAirHPEquationFit.setRatioofRatedHeatingCapacitytoRatedCoolingCapacity(1.2)); EXPECT_EQ(1.2, coilHeatingWaterToAirHPEquationFit.ratioofRatedHeatingCapacitytoRatedCoolingCapacity()); + + // test part load fraction correlation curve + EXPECT_FALSE(coilHeatingWaterToAirHPEquationFit.partLoadFractionCorrelationCurve()); + CurveQuadratic partLoadFractionCorrelationCurve(model); + coilHeatingWaterToAirHPEquationFit.setPartLoadFractionCorrelationCurve(partLoadFractionCorrelationCurve); + EXPECT_TRUE(coilHeatingWaterToAirHPEquationFit.partLoadFractionCorrelationCurve()); + coilHeatingWaterToAirHPEquationFit.resetPartLoadFractionCorrelationCurve(); + EXPECT_FALSE(coilHeatingWaterToAirHPEquationFit.partLoadFractionCorrelationCurve()); }