From b95e6200bc3806963ba6575b6457e468acc0dff4 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 12:27:50 -0700 Subject: [PATCH 01/32] Relax curve type for cc and ch watertoair heatpump eqnfit. --- ...ilCoolingWaterToAirHeatPumpEquationFit.cpp | 102 +++++++++--------- ...ilCoolingWaterToAirHeatPumpEquationFit.hpp | 21 ++-- ...lingWaterToAirHeatPumpEquationFit_Impl.hpp | 3 +- ...ilHeatingWaterToAirHeatPumpEquationFit.cpp | 66 ++++++------ ...ilHeatingWaterToAirHeatPumpEquationFit.hpp | 14 +-- ...tingWaterToAirHeatPumpEquationFit_Impl.hpp | 10 +- 6 files changed, 109 insertions(+), 107 deletions(-) diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp index a1b44bcbc0b..b6f44583573 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp @@ -19,6 +19,8 @@ #include "CurveQuadLinear_Impl.hpp" #include "CurveQuintLinear.hpp" #include "CurveQuintLinear_Impl.hpp" +#include "Curve.hpp" +#include "Curve_Impl.hpp" #include #include @@ -184,34 +186,34 @@ namespace model { return value.get(); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit_Impl::totalCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit_Impl::totalCoolingCapacityCurve() const { WorkspaceObject wo = getTarget(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::TotalCoolingCapacityCurveName).get(); - return wo.cast(); + return wo.cast(); } - CurveQuintLinear CoilCoolingWaterToAirHeatPumpEquationFit_Impl::sensibleCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit_Impl::sensibleCoolingCapacityCurve() const { WorkspaceObject wo = getTarget(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::SensibleCoolingCapacityCurveName).get(); - return wo.cast(); + return wo.cast(); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit_Impl::coolingPowerConsumptionCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit_Impl::coolingPowerConsumptionCurve() const { WorkspaceObject wo = getTarget(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::CoolingPowerConsumptionCurveName).get(); - return wo.cast(); + return wo.cast(); } - bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve) { bool result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::TotalCoolingCapacityCurveName, totalCoolingCapacityCurve.handle()); return result; } - bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve) { bool result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::SensibleCoolingCapacityCurveName, sensibleCoolingCapacityCurve.handle()); return result; } - bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve) { bool result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::CoolingPowerConsumptionCurveName, coolingPowerConsumptionCurve.handle()); return result; @@ -493,9 +495,9 @@ namespace model { // Ctors CoilCoolingWaterToAirHeatPumpEquationFit::CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, - const CurveQuadLinear& totalCoolingCapacityCurve, - const CurveQuintLinear& sensibleCoolingCapacityCurve, - const CurveQuadLinear& coolingPowerConsumptionCurve) + const Curve& totalCoolingCapacityCurve, + const Curve& sensibleCoolingCapacityCurve, + const Curve& coolingPowerConsumptionCurve) : WaterToAirComponent(CoilCoolingWaterToAirHeatPumpEquationFit::iddObjectType(), model) { OS_ASSERT(getImpl()); @@ -752,27 +754,27 @@ namespace model { return getImpl()->autosizedRatedSensibleCoolingCapacity(); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve() const { return getImpl()->totalCoolingCapacityCurve(); } - CurveQuintLinear CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve() const { return getImpl()->sensibleCoolingCapacityCurve(); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve() const { return getImpl()->coolingPowerConsumptionCurve(); } - bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve) { return getImpl()->setTotalCoolingCapacityCurve(totalCoolingCapacityCurve); } - bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve) { return getImpl()->setSensibleCoolingCapacityCurve(sensibleCoolingCapacityCurve); } - bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve) { return getImpl()->setCoolingPowerConsumptionCurve(coolingPowerConsumptionCurve); } @@ -785,7 +787,7 @@ namespace model { double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.coefficient1Constant(); } @@ -793,61 +795,61 @@ namespace model { DEPRECATED_AT_MSG(3, 2, 0, "Use " "CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.setCoefficient1Constant(totalCoolingCapacityCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.coefficient2w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient2(double totalCoolingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.setCoefficient2w(totalCoolingCapacityCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.coefficient3x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient3(double totalCoolingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.setCoefficient3x(totalCoolingCapacityCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.coefficient4y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient4(double totalCoolingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.setCoefficient4y(totalCoolingCapacityCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.coefficient5z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient5(double totalCoolingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); return curve.setCoefficient5z(totalCoolingCapacityCoefficient5); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient1Constant() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.coefficient1Constant(); } @@ -855,128 +857,128 @@ namespace model { DEPRECATED_AT_MSG(3, 2, 0, "Use " "CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient1Constant(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.setCoefficient1Constant(sensibleCoolingCapacityCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient2v() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.coefficient2v(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient2(double sensibleCoolingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient2v(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.setCoefficient2v(sensibleCoolingCapacityCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient3w() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.coefficient3w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient3(double sensibleCoolingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient3w(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.setCoefficient3w(sensibleCoolingCapacityCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient4x() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.coefficient4x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient4(double sensibleCoolingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient4x(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.setCoefficient4x(sensibleCoolingCapacityCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient5y() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.coefficient5y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient5(double sensibleCoolingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient5y(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.setCoefficient5y(sensibleCoolingCapacityCoefficient5); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient6() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient6z() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.coefficient6z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient6(double sensibleCoolingCapacityCoefficient6) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient6z(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); return curve.setCoefficient6z(sensibleCoolingCapacityCoefficient6); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient1(double coolingPowerConsumptionCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.setCoefficient1Constant(coolingPowerConsumptionCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.coefficient2w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient2(double coolingPowerConsumptionCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.setCoefficient2w(coolingPowerConsumptionCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.coefficient3x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient3(double coolingPowerConsumptionCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.setCoefficient3x(coolingPowerConsumptionCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.coefficient4y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient4(double coolingPowerConsumptionCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.setCoefficient4y(coolingPowerConsumptionCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.coefficient5z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient5(double coolingPowerConsumptionCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); return curve.setCoefficient5z(coolingPowerConsumptionCoefficient5); } diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp index b28146696d6..43ae6fc1367 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp @@ -15,8 +15,7 @@ namespace openstudio { namespace model { - class CurveQuadLinear; - class CurveQuintLinear; + class Curve; namespace detail { class CoilCoolingWaterToAirHeatPumpEquationFit_Impl; @@ -29,9 +28,9 @@ namespace model { /** @name Constructors and Destructors */ /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit with required curve objects */ - CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const CurveQuadLinear& totalCoolingCapacityCurve, - const CurveQuintLinear& sensibleCoolingCapacityCurve, - const CurveQuadLinear& coolingPowerConsumptionCurve); + CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& totalCoolingCapacityCurve, + const Curve& sensibleCoolingCapacityCurve, + const Curve& coolingPowerConsumptionCurve); /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit object and places it inside the model. The coil is fully initialized with all companion objects. */ CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model); @@ -81,7 +80,7 @@ namespace model { double ratedEnteringAirWetBulbTemperature() const; - CurveQuadLinear totalCoolingCapacityCurve() const; + Curve totalCoolingCapacityCurve() const; OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient1() const; OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient2() const; @@ -89,7 +88,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient4() const; OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient5() const; - CurveQuintLinear sensibleCoolingCapacityCurve() const; + Curve sensibleCoolingCapacityCurve() const; OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient1() const; OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient2() const; @@ -98,7 +97,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient5() const; OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient6() const; - CurveQuadLinear coolingPowerConsumptionCurve() const; + Curve coolingPowerConsumptionCurve() const; OS_DEPRECATED(3, 2, 0) double coolingPowerConsumptionCoefficient1() const; OS_DEPRECATED(3, 2, 0) double coolingPowerConsumptionCoefficient2() const; @@ -148,7 +147,7 @@ namespace model { bool setRatedEnteringAirWetBulbTemperature(double ratedEnteringAirWetBulbTemperature); - bool setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve); + bool setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve); OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient1(double totalCoolingCapacityCoefficient1); OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient2(double totalCoolingCapacityCoefficient2); @@ -156,7 +155,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient4(double totalCoolingCapacityCoefficient4); OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient5(double totalCoolingCapacityCoefficient5); - bool setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve); + bool setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve); OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient1(double sensibleCoolingCapacityCoefficient1); OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient2(double sensibleCoolingCapacityCoefficient2); @@ -165,7 +164,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient5(double sensibleCoolingCapacityCoefficient5); OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient6(double sensibleCoolingCapacityCoefficient6); - bool setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve); + bool setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve); OS_DEPRECATED(3, 2, 0) bool setCoolingPowerConsumptionCoefficient1(double coolingPowerConsumptionCoefficient1); OS_DEPRECATED(3, 2, 0) bool setCoolingPowerConsumptionCoefficient2(double coolingPowerConsumptionCoefficient2); diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp index 85d53ebbe76..e99c84ec9f0 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp @@ -12,8 +12,7 @@ namespace openstudio { namespace model { - class CurveQuadLinear; - class CurveQuintLinear; + class Curve namespace detail { diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp index 4ab5cb074cf..00758e980da 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 @@ -304,22 +306,22 @@ namespace model { return boost::none; } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingCapacityCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingCapacityCurve() const { WorkspaceObject wo = getTarget(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingCapacityCurveName).get(); - return wo.cast(); + return wo.cast(); } - bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingCapacityCurve(const Curve& heatingCapacityCurve) { bool result = setPointer(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingCapacityCurveName, heatingCapacityCurve.handle()); return result; } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingPowerConsumptionCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingPowerConsumptionCurve() const { WorkspaceObject wo = getTarget(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingPowerConsumptionCurveName).get(); - return wo.cast(); + return wo.cast(); } - bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve) { bool result = setPointer(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingPowerConsumptionCurveName, heatingPowerConsumptionCurve.handle()); return result; @@ -397,8 +399,8 @@ namespace model { } // namespace detail // create a new CoilHeatingWaterToAirHeatPumpEquationFit object in the model's workspace - CoilHeatingWaterToAirHeatPumpEquationFit::CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const CurveQuadLinear& heatingCapacityCurve, - const CurveQuadLinear& heatingPowerConsumptionCurve) + CoilHeatingWaterToAirHeatPumpEquationFit::CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& heatingCapacityCurve, + const Curve& heatingPowerConsumptionCurve) : WaterToAirComponent(CoilHeatingWaterToAirHeatPumpEquationFit::iddObjectType(), model) { OS_ASSERT(getImpl()); @@ -596,19 +598,19 @@ namespace model { return getImpl()->autosizedRatedHeatingCapacity(); } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve() const { return getImpl()->heatingCapacityCurve(); } - bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCurve(const Curve& heatingCapacityCurve) { return getImpl()->setHeatingCapacityCurve(heatingCapacityCurve); } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve() const { return getImpl()->heatingPowerConsumptionCurve(); } - bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve) { return getImpl()->setHeatingPowerConsumptionCurve(heatingPowerConsumptionCurve); } @@ -620,67 +622,67 @@ namespace model { // DEPRECATED double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.coefficient1Constant(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient1(double heatingCapacityCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.setCoefficient1Constant(heatingCapacityCoefficient1); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.coefficient2w(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient2(double heatingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.setCoefficient2w(heatingCapacityCoefficient2); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.coefficient3x(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient3(double heatingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.setCoefficient3x(heatingCapacityCoefficient3); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.coefficient4y(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient4(double heatingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.setCoefficient4y(heatingCapacityCoefficient4); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.coefficient5z(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient5(double heatingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); + Curve curve = getImpl()->heatingCapacityCurve(); return curve.setCoefficient5z(heatingCapacityCoefficient5); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.coefficient1Constant(); } @@ -688,55 +690,55 @@ namespace model { DEPRECATED_AT_MSG(3, 2, 0, "Use " "CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.setCoefficient1Constant(heatingPowerConsumptionCoefficient1); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.coefficient2w(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient2(double heatingPowerConsumptionCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.setCoefficient2w(heatingPowerConsumptionCoefficient2); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.coefficient3x(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient3(double heatingPowerConsumptionCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.setCoefficient3x(heatingPowerConsumptionCoefficient3); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.coefficient4y(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient4(double heatingPowerConsumptionCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.setCoefficient4y(heatingPowerConsumptionCoefficient4); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.coefficient5z(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient5(double heatingPowerConsumptionCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); return curve.setCoefficient5z(heatingPowerConsumptionCoefficient5); } diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp index 2b497d34190..1b93e17bea9 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp @@ -15,7 +15,7 @@ namespace openstudio { namespace model { - class CurveQuadLinear; + class Curve; namespace detail { @@ -31,8 +31,8 @@ namespace model { //@{ /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit with required curve objects */ - CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const CurveQuadLinear& heatingCapacityCurve, - const CurveQuadLinear& heatingPowerConsumptionCurve); + CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& heatingCapacityCurve, + const Curve& heatingPowerConsumptionCurve); CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model); @@ -78,7 +78,7 @@ namespace model { double ratioofRatedHeatingCapacitytoRatedCoolingCapacity() const; - CurveQuadLinear heatingCapacityCurve() const; + Curve heatingCapacityCurve() const; OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient1() const; OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient2() const; @@ -86,7 +86,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient4() const; OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient5() const; - CurveQuadLinear heatingPowerConsumptionCurve() const; + Curve heatingPowerConsumptionCurve() const; OS_DEPRECATED(3, 2, 0) double heatingPowerConsumptionCoefficient1() const; OS_DEPRECATED(3, 2, 0) double heatingPowerConsumptionCoefficient2() const; @@ -132,7 +132,7 @@ namespace model { bool setRatioofRatedHeatingCapacitytoRatedCoolingCapacity(double ratioofRatedHeatingCapacitytoRatedCoolingCapacity); - bool setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve); + bool setHeatingCapacityCurve(const Curve& heatingCapacityCurve); OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient1(double heatingCapacityCoefficient1); OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient2(double heatingCapacityCoefficient2); @@ -140,7 +140,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient4(double heatingCapacityCoefficient4); OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient5(double heatingCapacityCoefficient5); - bool setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve); + bool setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve); OS_DEPRECATED(3, 2, 0) bool setHeatingPowerConsumptionCoefficient1(double heatingPowerConsumptionCoefficient1); OS_DEPRECATED(3, 2, 0) bool setHeatingPowerConsumptionCoefficient2(double heatingPowerConsumptionCoefficient2); diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp index e3a9eaf65ca..61907e51730 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp @@ -12,7 +12,7 @@ namespace openstudio { namespace model { - class CurveQuadLinear; + class Curve; namespace detail { @@ -87,9 +87,9 @@ namespace model { double ratioofRatedHeatingCapacitytoRatedCoolingCapacity() const; - CurveQuadLinear heatingCapacityCurve() const; + Curve heatingCapacityCurve() const; - CurveQuadLinear heatingPowerConsumptionCurve() const; + Curve heatingPowerConsumptionCurve() const; boost::optional autosizedRatedAirFlowRate() const; @@ -139,9 +139,9 @@ namespace model { bool setRatioofRatedHeatingCapacitytoRatedCoolingCapacity(double ratioofRatedHeatingCapacitytoRatedCoolingCapacity); - bool setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve); + bool setHeatingCapacityCurve(const Curve& heatingCapacityCurve); - bool setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve); + bool setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve); //@} /** @name Other */ From b2adc95d7f4e36755ad2d77299714d67736bc09c Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 12:28:02 -0700 Subject: [PATCH 02/32] Update the ft files. --- ...orwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp | 3 +-- ...orwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp index c3e4c731859..f4a7631921d 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp @@ -11,8 +11,7 @@ #include "../../model/Node_Impl.hpp" #include "../../model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp" #include "../../model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp" -#include "../../model/CurveQuadLinear.hpp" -#include "../../model/CurveQuintLinear.hpp" +#include "../../model/Curve.hpp" #include "../../utilities/core/Logger.hpp" #include "../../utilities/core/Assert.hpp" diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp index 2d796a8b2c9..6f65935223f 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp @@ -11,7 +11,7 @@ #include "../../model/Node_Impl.hpp" #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp" #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp" -#include "../../model/CurveQuadLinear.hpp" +#include "../../model/Curve.hpp" #include "../../utilities/core/Logger.hpp" #include "../../utilities/core/Assert.hpp" From a7c978a47571f1fb98c548b97d135e5aa75fb0a3 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 12:28:24 -0700 Subject: [PATCH 03/32] Add a new model test for tablelookup. --- src/model/test/TableLookup_GTest.cpp | 130 +++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/src/model/test/TableLookup_GTest.cpp b/src/model/test/TableLookup_GTest.cpp index 0711d2c9fbd..0b2f2c965a4 100644 --- a/src/model/test/TableLookup_GTest.cpp +++ b/src/model/test/TableLookup_GTest.cpp @@ -15,6 +15,14 @@ #include "../ModelObjectList_Impl.hpp" #include "../BoilerHotWater.hpp" #include "../BoilerHotWater_Impl.hpp" +#include "../CoilCoolingWaterToAirHeatPumpEquationFit.hpp" +#include "../CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp" +#include "../CoilHeatingWaterToAirHeatPumpEquationFit.hpp" +#include "../CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp" +#include "../CurveQuadLinear.hpp" +#include "../CurveQuadLinear_Impl.hpp" +#include "../CurveQuintLinear.hpp" +#include "../CurveQuintLinear_Impl.hpp" using namespace openstudio; using namespace openstudio::model; @@ -263,3 +271,125 @@ TEST_F(ModelFixture, TableLookup_Remove) { EXPECT_EQ(independentVariable1, tableLookup2.independentVariables().front()); } } + +TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { + // Test for #4946 - WaterToAirHeatPumpEquationFit curves do not support Table:Lookup + + Model m; + + // test ctor 1 + { + // ctor maintains backward compatibility + CoilCoolingWaterToAirHeatPumpEquationFit cc(m); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + + CoilHeatingWaterToAirHeatPumpEquationFit ch(m); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + } + + // test ctor 2 + { + // ctor maintains backward compatibility + CurveQuadLinear tccc(m); + CurveQuintLinear sccc(m); + CurveQuadLinear cpcc(m); + CoilCoolingWaterToAirHeatPumpEquationFit cc(m, tccc, sccc, cpcc); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tccc, cc.totalCoolingCapacityCurve()); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(sccc, cc.sensibleCoolingCapacityCurve()); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(cpcc, cc.coolingPowerConsumptionCurve()); + + CurveQuadLinear hcc(m); + CurveQuadLinear hpcc(m); + CoilHeatingWaterToAirHeatPumpEquationFit ch(m, hcc, hpcc); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(hcc, ch.heatingCapacityCurve()); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(hpcc, ch.heatingPowerConsumptionCurve()); + } + + { + // ctor can now handle table lookup curves + TableLookup tl1(m); + TableLookup tl2(m); + TableLookup tl3(m); + CoilCoolingWaterToAirHeatPumpEquationFit cc(m, tl1, tl2, tl3); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tl1, cc.totalCoolingCapacityCurve()); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tl2, cc.sensibleCoolingCapacityCurve()); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tl3, cc.coolingPowerConsumptionCurve()); + + TableLookup tl4(m); + TableLookup tl5(m); + CoilHeatingWaterToAirHeatPumpEquationFit ch(m, tl4, tl5); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(tl4, ch.heatingCapacityCurve()); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tl5, ch.heatingPowerConsumptionCurve()); + } + + // test new setter/getter + { + CoilCoolingWaterToAirHeatPumpEquationFit cc(m); + CoilHeatingWaterToAirHeatPumpEquationFit ch(m); + + // setter maintains backward compatibility + CurveQuadLinear cql1(m); + EXPECT_TRUE(cc.setTotalCoolingCapacityCurve(cql1)); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(cql2, cc.totalCoolingCapacityCurve()); + + CurveQuintLinear cql2(m) + EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(cql2)); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(cql2, cc.sensibleCoolingCapacityCurve()); + + CurveQuadLinear cql3(m) + EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(cql3)); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(cql3, cc.coolingPowerConsumptionCurve()); + + CurveQuadLinear cql4(m); + EXPECT_TRUE(ch.setHeatingCapacityCurve(cql1)); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(cql4, ch.heatingCapacityCurve()); + + CurveQuadLinear cql5(m); + EXPECT_TRUE(ch.setHeatingPowerConsumptionCurve(cql1)); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(cql5, ch.heatingPowerConsumptionCurve()); + + // setter can now handle table lookup curves + TableLookup tbl1(m); + EXPECT_TRUE(cc.setTotalCoolingCapacityCurve(tbl1)); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tbl1, cc.totalCoolingCapacityCurve()); + + TableLookup tbl1(m) + EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(tbl1)); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tbl1, cc.sensibleCoolingCapacityCurve()); + + TableLookup tbl3(m) + EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(tbl3)); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tbl3, cc.coolingPowerConsumptionCurve()); + + TableLookup tbl4(m); + EXPECT_TRUE(ch.setHeatingCapacityCurve(tbl4)); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(tbl4, ch.heatingCapacityCurve()); + + TableLookup tbl5(m); + EXPECT_TRUE(ch.setHeatingPowerConsumptionCurve(tbl5)); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tbl5, ch.heatingPowerConsumptionCurve()); + } +} From 7080b1d3cc109290e0c2ed55fc4580bee783aa28 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 12:28:36 -0700 Subject: [PATCH 04/32] Add entry to release notes. --- .../doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md index 0d145e891d7..3d0edc63d57 100644 --- a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md +++ b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md @@ -82,6 +82,8 @@ You can also refer to the [OpenStudio SDK Python Binding Version Compatibility M * Fix #4930 - Support undisturbed ground temperature models on GroundHeatExchangerVertical * Update `GroundHeatExchanger:Vertical` to actually use the Ground Temeprature Model field * [#4923](https://github.com/NREL/OpenStudio/pull/4923) - Fix #4692 - Modify `Model::load` to use the VersionTranslator instead of loading it assuming the version of the loaded OSM is the same as the current SDK version being used. +* [#xxxx](https://github.com/NREL/OpenStudio/pull/xxxx) - Addresses #4946, allow Table:Lookup curves for Coil:*:WaterToAirHeatPumpEquationFit objects + * `Coil:Cooling:WaterToAirHeatPumpEquationFit` and `Coil:Heating:WaterToAirHeatPumpEquationFit` have a few API-breaking changes related to its Curves. The types for the constructor, getters, and setters used to be explicit (e.g., `CurveQuadLinear`); it is now the base class, more generic, `Curve` type for added flexibility. ## Minor changes and bug fixes From e990ddddc6d4957e5a324955dcf8d1856cdb3b68 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 12:28:49 -0700 Subject: [PATCH 05/32] Formatting. --- ...ilCoolingWaterToAirHeatPumpEquationFit.cpp | 3 +- ...ilCoolingWaterToAirHeatPumpEquationFit.hpp | 3 +- ...lingWaterToAirHeatPumpEquationFit_Impl.hpp | 3 +- ...ilHeatingWaterToAirHeatPumpEquationFit.hpp | 3 +- src/model/test/TableLookup_GTest.cpp | 30 ++++++++----------- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp index b6f44583573..41a23147dfb 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp @@ -494,8 +494,7 @@ namespace model { } // namespace detail // Ctors - CoilCoolingWaterToAirHeatPumpEquationFit::CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, - const Curve& totalCoolingCapacityCurve, + CoilCoolingWaterToAirHeatPumpEquationFit::CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& totalCoolingCapacityCurve, const Curve& sensibleCoolingCapacityCurve, const Curve& coolingPowerConsumptionCurve) : WaterToAirComponent(CoilCoolingWaterToAirHeatPumpEquationFit::iddObjectType(), model) { diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp index 43ae6fc1367..2b28bfdbbe9 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp @@ -28,8 +28,7 @@ namespace model { /** @name Constructors and Destructors */ /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit with required curve objects */ - CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& totalCoolingCapacityCurve, - const Curve& sensibleCoolingCapacityCurve, + CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& totalCoolingCapacityCurve, const Curve& sensibleCoolingCapacityCurve, const Curve& coolingPowerConsumptionCurve); /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit object and places it inside the model. The coil is fully initialized with all companion objects. */ diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp index e99c84ec9f0..0afe0e49ab6 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp @@ -14,7 +14,8 @@ namespace model { class Curve - namespace detail { + namespace detail + { class MODEL_API CoilCoolingWaterToAirHeatPumpEquationFit_Impl : public WaterToAirComponent_Impl { diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp index 1b93e17bea9..294a86e7ab4 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp @@ -31,8 +31,7 @@ namespace model { //@{ /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit with required curve objects */ - CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& heatingCapacityCurve, - const Curve& heatingPowerConsumptionCurve); + CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& heatingCapacityCurve, const Curve& heatingPowerConsumptionCurve); CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model); diff --git a/src/model/test/TableLookup_GTest.cpp b/src/model/test/TableLookup_GTest.cpp index 0b2f2c965a4..3b7e4c47c25 100644 --- a/src/model/test/TableLookup_GTest.cpp +++ b/src/model/test/TableLookup_GTest.cpp @@ -289,7 +289,7 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); } - + // test ctor 2 { // ctor maintains backward compatibility @@ -303,7 +303,7 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { EXPECT_EQ(sccc, cc.sensibleCoolingCapacityCurve()); ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(cpcc, cc.coolingPowerConsumptionCurve()); - + CurveQuadLinear hcc(m); CurveQuadLinear hpcc(m); CoilHeatingWaterToAirHeatPumpEquationFit ch(m, hcc, hpcc); @@ -312,7 +312,7 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(hpcc, ch.heatingPowerConsumptionCurve()); } - + { // ctor can now handle table lookup curves TableLookup tl1(m); @@ -334,7 +334,7 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(tl5, ch.heatingPowerConsumptionCurve()); } - + // test new setter/getter { CoilCoolingWaterToAirHeatPumpEquationFit cc(m); @@ -345,14 +345,12 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { EXPECT_TRUE(cc.setTotalCoolingCapacityCurve(cql1)); ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); EXPECT_EQ(cql2, cc.totalCoolingCapacityCurve()); - - CurveQuintLinear cql2(m) - EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(cql2)); + + CurveQuintLinear cql2(m) EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(cql2)); ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); EXPECT_EQ(cql2, cc.sensibleCoolingCapacityCurve()); - - CurveQuadLinear cql3(m) - EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(cql3)); + + CurveQuadLinear cql3(m) EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(cql3)); ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(cql3, cc.coolingPowerConsumptionCurve()); @@ -365,20 +363,18 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { EXPECT_TRUE(ch.setHeatingPowerConsumptionCurve(cql1)); ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(cql5, ch.heatingPowerConsumptionCurve()); - + // setter can now handle table lookup curves TableLookup tbl1(m); EXPECT_TRUE(cc.setTotalCoolingCapacityCurve(tbl1)); ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); EXPECT_EQ(tbl1, cc.totalCoolingCapacityCurve()); - - TableLookup tbl1(m) - EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(tbl1)); + + TableLookup tbl1(m) EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(tbl1)); ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); EXPECT_EQ(tbl1, cc.sensibleCoolingCapacityCurve()); - - TableLookup tbl3(m) - EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(tbl3)); + + TableLookup tbl3(m) EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(tbl3)); ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(tbl3, cc.coolingPowerConsumptionCurve()); From bae163a3a0dbe423f485bc9eac755881219e965d Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 12:32:44 -0700 Subject: [PATCH 06/32] Update the release notes. --- .../doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md index 3d0edc63d57..45b7975013c 100644 --- a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md +++ b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md @@ -82,7 +82,7 @@ You can also refer to the [OpenStudio SDK Python Binding Version Compatibility M * Fix #4930 - Support undisturbed ground temperature models on GroundHeatExchangerVertical * Update `GroundHeatExchanger:Vertical` to actually use the Ground Temeprature Model field * [#4923](https://github.com/NREL/OpenStudio/pull/4923) - Fix #4692 - Modify `Model::load` to use the VersionTranslator instead of loading it assuming the version of the loaded OSM is the same as the current SDK version being used. -* [#xxxx](https://github.com/NREL/OpenStudio/pull/xxxx) - Addresses #4946, allow Table:Lookup curves for Coil:*:WaterToAirHeatPumpEquationFit objects +* [#4950](https://github.com/NREL/OpenStudio/pull/4950) - Addresses #4946, allow Table:Lookup curves for Coil:*:WaterToAirHeatPumpEquationFit objects * `Coil:Cooling:WaterToAirHeatPumpEquationFit` and `Coil:Heating:WaterToAirHeatPumpEquationFit` have a few API-breaking changes related to its Curves. The types for the constructor, getters, and setters used to be explicit (e.g., `CurveQuadLinear`); it is now the base class, more generic, `Curve` type for added flexibility. ## Minor changes and bug fixes From 4f9caa5ec4ce79c576d9f0a00a7c160e6ac8ba8f Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 13:44:57 -0700 Subject: [PATCH 07/32] Few typos. --- ...oolingWaterToAirHeatPumpEquationFit_Impl.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp index 0afe0e49ab6..4798c3dba4e 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp @@ -12,10 +12,9 @@ namespace openstudio { namespace model { - class Curve + class Curve; - namespace detail - { + namespace detail { class MODEL_API CoilCoolingWaterToAirHeatPumpEquationFit_Impl : public WaterToAirComponent_Impl { @@ -98,11 +97,11 @@ namespace model { double ratedEnteringAirWetBulbTemperature() const; - CurveQuadLinear totalCoolingCapacityCurve() const; + Curve totalCoolingCapacityCurve() const; - CurveQuintLinear sensibleCoolingCapacityCurve() const; + Curve sensibleCoolingCapacityCurve() const; - CurveQuadLinear coolingPowerConsumptionCurve() const; + Curve coolingPowerConsumptionCurve() const; double nominalTimeforCondensateRemovaltoBegin() const; @@ -160,11 +159,11 @@ namespace model { bool setRatedEnteringAirWetBulbTemperature(double ratedEnteringAirWetBulbTemperature); - bool setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve); + bool setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve); - bool setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve); + bool setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve); - bool setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve); + bool setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve); bool setNominalTimeforCondensateRemovaltoBegin(double nominalTimeforCondensateRemovaltoBegin); From 30a2911a4022649e874b47d152933f36cf8d47d7 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 16:35:00 -0700 Subject: [PATCH 08/32] Try to fix deprecated methods. --- ...ilCoolingWaterToAirHeatPumpEquationFit.cpp | 96 ++++++++++++------- ...ilHeatingWaterToAirHeatPumpEquationFit.cpp | 60 ++++++++---- 2 files changed, 104 insertions(+), 52 deletions(-) diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp index 41a23147dfb..04ff80267a1 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp @@ -787,7 +787,8 @@ namespace model { double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient1Constant() instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient1Constant(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient1(double totalCoolingCapacityCoefficient1) { @@ -795,61 +796,71 @@ namespace model { "Use " "CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient1Constant(double) instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient1Constant(totalCoolingCapacityCoefficient1); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(totalCoolingCapacityCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient2w() instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient2w(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient2(double totalCoolingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient2w(double) instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient2w(totalCoolingCapacityCoefficient2); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(totalCoolingCapacityCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient3x() instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient3x(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient3(double totalCoolingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient3x(double) instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient3x(totalCoolingCapacityCoefficient3); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(totalCoolingCapacityCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient4y() instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient4y(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient4(double totalCoolingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient4y(double) instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient4y(totalCoolingCapacityCoefficient4); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(totalCoolingCapacityCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient5z() instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient5z(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient5(double totalCoolingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient5z(double) instead."); Curve curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient5z(totalCoolingCapacityCoefficient5); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(totalCoolingCapacityCoefficient5); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient1Constant() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient1Constant(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient1(double sensibleCoolingCapacityCoefficient1) { @@ -857,128 +868,149 @@ namespace model { "Use " "CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient1Constant(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient1Constant(sensibleCoolingCapacityCoefficient1); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(sensibleCoolingCapacityCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient2v() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient2v(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2v(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient2(double sensibleCoolingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient2v(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient2v(sensibleCoolingCapacityCoefficient2); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2v(sensibleCoolingCapacityCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient3w() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient3w(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient3(double sensibleCoolingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient3w(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient3w(sensibleCoolingCapacityCoefficient3); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3w(sensibleCoolingCapacityCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient4x() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient4x(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient4(double sensibleCoolingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient4x(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient4x(sensibleCoolingCapacityCoefficient4); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4x(sensibleCoolingCapacityCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient5y() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient5y(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient5(double sensibleCoolingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient5y(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient5y(sensibleCoolingCapacityCoefficient5); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5y(sensibleCoolingCapacityCoefficient5); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient6() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient6z() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient6z(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient6z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient6(double sensibleCoolingCapacityCoefficient6) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient6z(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient6z(sensibleCoolingCapacityCoefficient6); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient6z(sensibleCoolingCapacityCoefficient6); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient1Constant() instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient1Constant(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient1(double coolingPowerConsumptionCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient1Constant(double) instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient1Constant(coolingPowerConsumptionCoefficient1); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(coolingPowerConsumptionCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient2w() instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient2w(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient2(double coolingPowerConsumptionCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient2w(double) instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient2w(coolingPowerConsumptionCoefficient2); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(coolingPowerConsumptionCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient3x() instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient3x(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient3(double coolingPowerConsumptionCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient3x(double) instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient3x(coolingPowerConsumptionCoefficient3); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(coolingPowerConsumptionCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient4y() instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient4y(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient4(double coolingPowerConsumptionCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient4y(double) instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient4y(coolingPowerConsumptionCoefficient4); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(coolingPowerConsumptionCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient5z() instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient5z(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient5(double coolingPowerConsumptionCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient5z(double) instead."); Curve curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient5z(coolingPowerConsumptionCoefficient5); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(coolingPowerConsumptionCoefficient5); } /// @endcond diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp index 00758e980da..32d008473e8 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp @@ -623,67 +623,78 @@ namespace model { double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient1Constant() instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient1Constant(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient1(double heatingCapacityCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient1Constant(double) instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient1Constant(heatingCapacityCoefficient1); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(heatingCapacityCoefficient1); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient2w() instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient2w(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient2(double heatingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient2w(double) instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient2w(heatingCapacityCoefficient2); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(heatingCapacityCoefficient2); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient3x() instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient3x(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient3(double heatingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient3x(double) instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient3x(heatingCapacityCoefficient3); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(heatingCapacityCoefficient3); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient4y() instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient4y(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient4(double heatingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient4y(double) instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient4y(heatingCapacityCoefficient4); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(heatingCapacityCoefficient4); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient5z() instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient5z(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient5(double heatingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient5z(double) instead."); Curve curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient5z(heatingCapacityCoefficient5); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(heatingCapacityCoefficient5); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient1Constant() instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient1Constant(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient1(double heatingPowerConsumptionCoefficient1) { @@ -691,55 +702,64 @@ namespace model { "Use " "CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient1Constant(double) instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient1Constant(heatingPowerConsumptionCoefficient1); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(heatingPowerConsumptionCoefficient1); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient2w() instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient2w(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient2(double heatingPowerConsumptionCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient2w(double) instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient2w(heatingPowerConsumptionCoefficient2); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(heatingPowerConsumptionCoefficient2); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient3x() instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient3x(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient3(double heatingPowerConsumptionCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient3x(double) instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient3x(heatingPowerConsumptionCoefficient3); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(heatingPowerConsumptionCoefficient3); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient4y() instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient4y(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient4(double heatingPowerConsumptionCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient4y(double) instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient4y(heatingPowerConsumptionCoefficient4); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(heatingPowerConsumptionCoefficient4); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient5z() instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient5z(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient5(double heatingPowerConsumptionCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient5z(double) instead."); Curve curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient5z(heatingPowerConsumptionCoefficient5); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(heatingPowerConsumptionCoefficient5); } /// @endcond From e58a3771b5805db87b0f6a79b28c51beb803c7be Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 16:35:14 -0700 Subject: [PATCH 09/32] Update sdd maphvac cpp. --- src/sdd/MapHVAC.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/sdd/MapHVAC.cpp b/src/sdd/MapHVAC.cpp index 37c410a0c1d..2604701be6a 100644 --- a/src/sdd/MapHVAC.cpp +++ b/src/sdd/MapHVAC.cpp @@ -2220,14 +2220,16 @@ namespace sdd { coil.setRatedHeatingCoefficientofPerformance(1.0 / _htPumpEIR.get()); } - model::CurveQuadLinear heatingCapacityCurve = coil.heatingCapacityCurve(); + model::Curve _heatingCapacityCurve = coil.heatingCapacityCurve(); + model::CurveQuadLinear heatingCapacityCurve = _heatingCapacityCurve.cast(); heatingCapacityCurve.setCoefficient1Constant(-1.361311959); heatingCapacityCurve.setCoefficient2w(-2.471798046); heatingCapacityCurve.setCoefficient3x(4.173164514); heatingCapacityCurve.setCoefficient4y(0.640757401); heatingCapacityCurve.setCoefficient5z(0.0); - model::CurveQuadLinear heatingPowerConsumptionCurve = coil.heatingPowerConsumptionCurve(); + model::Curve _heatingPowerConsumptionCurve = coil.heatingPowerConsumptionCurve(); + model::CurveQuadLinear heatingPowerConsumptionCurve = _heatingPowerConsumptionCurve.cast(); heatingPowerConsumptionCurve.setCoefficient1Constant(-2.176941116); heatingPowerConsumptionCurve.setCoefficient2w(0.832114286); heatingPowerConsumptionCurve.setCoefficient3x(1.570743399); @@ -3022,14 +3024,16 @@ namespace sdd { coil.setRatedCoolingCoefficientofPerformance(1.0 / _dxEIR.get()); } - model::CurveQuadLinear totalCoolingCapacityCurve = coil.totalCoolingCapacityCurve(); + model::Curve _totalCoolingCapacityCurve = coil.totalCoolingCapacityCurve(); + model::CurveQuadLinear totalCoolingCapacityCurve = _totalCoolingCapacityCurve.cast(); totalCoolingCapacityCurve.setCoefficient1Constant(-9.149069561); totalCoolingCapacityCurve.setCoefficient2w(10.87814026); totalCoolingCapacityCurve.setCoefficient3x(-1.718780157); totalCoolingCapacityCurve.setCoefficient4y(0.746414818); totalCoolingCapacityCurve.setCoefficient5z(0.0); - model::CurveQuintLinear sensibleCoolingCapacityCurve = coil.sensibleCoolingCapacityCurve(); + model::Curve _sensibleCoolingCapacityCurve = coil.sensibleCoolingCapacityCurve(); + model::CurveQuintLinear sensibleCoolingCapacityCurve = _sensibleCoolingCapacityCurve.cast(); sensibleCoolingCapacityCurve.setCoefficient1Constant(-5.462690012); sensibleCoolingCapacityCurve.setCoefficient2v(17.95968138); sensibleCoolingCapacityCurve.setCoefficient3w(-11.87818402); @@ -3037,7 +3041,8 @@ namespace sdd { sensibleCoolingCapacityCurve.setCoefficient5y(0.767285761); sensibleCoolingCapacityCurve.setCoefficient6z(0.0); - model::CurveQuadLinear coolingPowerConsumptionCurve = coil.coolingPowerConsumptionCurve(); + model::Curve _coolingPowerConsumptionCurve = coil.coolingPowerConsumptionCurve(); + model::CurveQuadLinear coolingPowerConsumptionCurve = _coolingPowerConsumptionCurve.cast(); coolingPowerConsumptionCurve.setCoefficient1Constant(-3.20456384); coolingPowerConsumptionCurve.setCoefficient2w(-0.976409399); coolingPowerConsumptionCurve.setCoefficient3x(3.97892546); From efa73ddc9b3477c936b5941d726eb405024d1092 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Tue, 29 Aug 2023 20:41:42 -0700 Subject: [PATCH 10/32] Fix handling deprecated methods. --- ...ilCoolingWaterToAirHeatPumpEquationFit.cpp | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp index 04ff80267a1..6deb6ffa090 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp @@ -859,8 +859,8 @@ namespace model { double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient1Constant() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->coefficient1Constant(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient1(double sensibleCoolingCapacityCoefficient1) { @@ -868,78 +868,78 @@ namespace model { "Use " "CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient1Constant(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->setCoefficient1Constant(sensibleCoolingCapacityCoefficient1); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient1Constant(sensibleCoolingCapacityCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient2v() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->coefficient2v(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient2v(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient2(double sensibleCoolingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient2v(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->setCoefficient2v(sensibleCoolingCapacityCoefficient2); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient2v(sensibleCoolingCapacityCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient3w() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->coefficient3w(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient3w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient3(double sensibleCoolingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient3w(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->setCoefficient3w(sensibleCoolingCapacityCoefficient3); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient3w(sensibleCoolingCapacityCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient4x() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->coefficient4x(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient4x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient4(double sensibleCoolingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient4x(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->setCoefficient4x(sensibleCoolingCapacityCoefficient4); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient4x(sensibleCoolingCapacityCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient5y() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->coefficient5y(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient5y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient5(double sensibleCoolingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient5y(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->setCoefficient5y(sensibleCoolingCapacityCoefficient5); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient5y(sensibleCoolingCapacityCoefficient5); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient6() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient6z() instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->coefficient6z(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient6z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient6(double sensibleCoolingCapacityCoefficient6) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient6z(double) instead."); Curve curve = getImpl()->sensibleCoolingCapacityCurve(); - boost::optional curveQuadLinear = curve.optionalCast(); - return curveQuadLinear->setCoefficient6z(sensibleCoolingCapacityCoefficient6); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient6z(sensibleCoolingCapacityCoefficient6); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient1() const { From d01843a55ba282c5f3c83415180a5a6203f1fc9c Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 30 Aug 2023 08:41:03 -0700 Subject: [PATCH 11/32] Fix typos in new model test. --- src/model/test/TableLookup_GTest.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/model/test/TableLookup_GTest.cpp b/src/model/test/TableLookup_GTest.cpp index 3b7e4c47c25..cde00224206 100644 --- a/src/model/test/TableLookup_GTest.cpp +++ b/src/model/test/TableLookup_GTest.cpp @@ -344,13 +344,15 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { CurveQuadLinear cql1(m); EXPECT_TRUE(cc.setTotalCoolingCapacityCurve(cql1)); ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); - EXPECT_EQ(cql2, cc.totalCoolingCapacityCurve()); + EXPECT_EQ(cql1, cc.totalCoolingCapacityCurve()); - CurveQuintLinear cql2(m) EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(cql2)); + CurveQuintLinear cql2(m); + EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(cql2)); ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); EXPECT_EQ(cql2, cc.sensibleCoolingCapacityCurve()); - CurveQuadLinear cql3(m) EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(cql3)); + CurveQuadLinear cql3(m); + EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(cql3)); ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(cql3, cc.coolingPowerConsumptionCurve()); @@ -370,11 +372,13 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); EXPECT_EQ(tbl1, cc.totalCoolingCapacityCurve()); - TableLookup tbl1(m) EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(tbl1)); + TableLookup tbl2(m); + EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(tbl2)); ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); - EXPECT_EQ(tbl1, cc.sensibleCoolingCapacityCurve()); + EXPECT_EQ(tbl2, cc.sensibleCoolingCapacityCurve()); - TableLookup tbl3(m) EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(tbl3)); + TableLookup tbl3(m); + EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(tbl3)); ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(tbl3, cc.coolingPowerConsumptionCurve()); From b0f6f2ebd73016407594ebfc50279c040fc48fc2 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 30 Aug 2023 09:50:34 -0700 Subject: [PATCH 12/32] More typos in new model test. --- src/model/test/TableLookup_GTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/test/TableLookup_GTest.cpp b/src/model/test/TableLookup_GTest.cpp index cde00224206..4156343639d 100644 --- a/src/model/test/TableLookup_GTest.cpp +++ b/src/model/test/TableLookup_GTest.cpp @@ -357,12 +357,12 @@ TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { EXPECT_EQ(cql3, cc.coolingPowerConsumptionCurve()); CurveQuadLinear cql4(m); - EXPECT_TRUE(ch.setHeatingCapacityCurve(cql1)); + EXPECT_TRUE(ch.setHeatingCapacityCurve(cql4)); ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); EXPECT_EQ(cql4, ch.heatingCapacityCurve()); CurveQuadLinear cql5(m); - EXPECT_TRUE(ch.setHeatingPowerConsumptionCurve(cql1)); + EXPECT_TRUE(ch.setHeatingPowerConsumptionCurve(cql5)); ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); EXPECT_EQ(cql5, ch.heatingPowerConsumptionCurve()); From b5d7c006ab9511c1ca35c378cc09bc8567403d00 Mon Sep 17 00:00:00 2001 From: Kyle Benne Date: Tue, 19 Sep 2023 10:23:15 -0500 Subject: [PATCH 13/32] Improve OpenStudio's support for Python unitttest In the Python unittest library, unittest.main() was not working as expected, because tests defined in the __main__ scope where not being detected. This meant that `openstudio labs execute_python_script foo_measure_test.rb` did not work as expected. The solution here is to register the __main__ module properly within Python. * An example Measure test is located at https://github.com/NREL/openstudio-common-measures-gem/commit/0c73cdb0dcde1eac960628e3c4ee853f18ef0f3f * A Measure test can be invoked with `openstudio labs --python_path=. execute_python_script tests/test_measure.py` close #4906 --- src/cli/UpdateCommand.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli/UpdateCommand.cpp b/src/cli/UpdateCommand.cpp index 1a5ede67111..ba65fb8be6f 100644 --- a/src/cli/UpdateCommand.cpp +++ b/src/cli/UpdateCommand.cpp @@ -104,8 +104,10 @@ sys.argv.append("{}") } cmd += fmt::format(R"python( import importlib.util -spec = importlib.util.spec_from_file_location('__main__', r'{}') +module_name = '__main__' +spec = importlib.util.spec_from_file_location(module_name, r'{}') module = importlib.util.module_from_spec(spec) +sys.modules[module_name] = module spec.loader.exec_module(module) )python", pythonScriptPath.generic_string()); From b0f0f906a805cb42b45e242c1046d09d8a68ffd7 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 19 Sep 2023 23:58:25 +0200 Subject: [PATCH 14/32] Fix #4969 - add `json_schemer` to embedded ruby gems --- CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba93257831a..a4fd88bc1d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -833,19 +833,19 @@ if(BUILD_CLI) if(UNIX) if(APPLE) if (ARCH MATCHES arm64) - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-darwin_arm64.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "27ca992c6e5fe5347a7e342eb5b91511") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-darwin_arm64.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "404783d585a63a07f2f9d5b4ba445d99") else() - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-darwin.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "b6bf19e6958bd41be9788a7f16fd7f27") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-darwin.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "71282202360c68cf9dd0f0d585d560f2") endif() else() if (ARCH MATCHES "arm64") - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-linux_arm64.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "979a8839facf2fa1c4096dcbae39ddc2") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-linux_arm64.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "TODO____TDB") else() - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-linux.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "957681cb4f3b5cf8ad95103a5fae9a72") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-linux.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "f7279e86e0a9f41cfd0ce89060c4d836") endif() if (USE_OPENSTUDIO_GEMS_PR) set(OPENSTUDIO_GEMS_BASEURL "${OPENSTUDIO_GEMS_BASEURL}/openstudio-gems-linux/${OPENSTUDIO_GEMS_PR_NUMBER}") @@ -853,8 +853,8 @@ if(BUILD_CLI) endif() elseif(WIN32) # OpenStudio gems are only supported on 64 bit windows - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-windows.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "e82889c296b7b76eb1f7b3fc7e22d2aa") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-windows.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "1606f5db801064864c1dc22e8e23459e") if (USE_OPENSTUDIO_GEMS_PR) set(OPENSTUDIO_GEMS_BASEURL "${OPENSTUDIO_GEMS_BASEURL}/openstudio-gems-windows/${OPENSTUDIO_GEMS_PR_NUMBER}") endif() From 331b3d7b1585dc72eaa6216fe6acf2225fccbcdf Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 20 Sep 2023 00:18:50 +0200 Subject: [PATCH 15/32] Add arm64 linux (aarch64) openstudio3-gems md5sum [skip ci] --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4fd88bc1d1..836e429b0e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -842,7 +842,7 @@ if(BUILD_CLI) else() if (ARCH MATCHES "arm64") set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-linux_arm64.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "TODO____TDB") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "c28e1b84051fbae2ae0a9f7a27416951") else() set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-linux.tar.gz") set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "f7279e86e0a9f41cfd0ce89060c4d836") From 25555650288f8891450b59d19b7d04eda52a9052 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 20 Sep 2023 08:45:53 +0200 Subject: [PATCH 16/32] Add a quick test for the embedded json_schemer --- src/cli/test/test_embedded_ruby.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/cli/test/test_embedded_ruby.rb b/src/cli/test/test_embedded_ruby.rb index ccb0c4bcd7b..8a8c4fd5e81 100644 --- a/src/cli/test/test_embedded_ruby.rb +++ b/src/cli/test/test_embedded_ruby.rb @@ -233,4 +233,21 @@ def test_msgpack assert(data == data2) end + def test_json_schemer + require 'json_schemer' + + schema = { + 'type' => 'object', + 'properties' => { + 'abc' => { + 'type' => 'integer', + 'minimum' => 11 + } + } + } + schemer = JSONSchemer.schema(schema) + assert(schemer.valid?({ 'abc' => 11 })) + assert(!schemer.valid?({ 'abc' => 10 })) + end + end From 7e8f062ec2b8983ab726a676989692cdbddf01a5 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 18 Sep 2023 21:09:23 +0200 Subject: [PATCH 17/32] Potential fix for #4963 - When Method is None or empty, doesn't matter if the flow rate is Autosized, it takes precendence cf https://github.com/NREL/EnergyPlus/blob/4502b0c6561281693f837217eb99339372b86abd/src/EnergyPlus/UnitarySystem.cc#L6080-L6081 --- src/model/AirLoopHVACUnitarySystem.cpp | 2 +- src/model/test/AirLoopHVACUnitarySystem_GTest.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/model/AirLoopHVACUnitarySystem.cpp b/src/model/AirLoopHVACUnitarySystem.cpp index 02fdd8168c2..83d74760264 100644 --- a/src/model/AirLoopHVACUnitarySystem.cpp +++ b/src/model/AirLoopHVACUnitarySystem.cpp @@ -1391,7 +1391,7 @@ namespace model { OS_ASSERT(ok); getImpl()->setSupplyAirFlowRateMethodDuringCoolingOperation("None"); getImpl()->setSupplyAirFlowRateMethodDuringHeatingOperation("None"); - autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); setMaximumSupplyAirTemperature(80.0); setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(21.0); ok = setMaximumCyclingRate(2.5); diff --git a/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp b/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp index 43f275c1b8f..a9f2461a00f 100644 --- a/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp +++ b/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp @@ -121,6 +121,7 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_CloneOneModelWithDefaultData) { testObject.setCoolingCoil(coolingCoil); testObject.setHeatingCoil(heatingCoil); testObject.setSupplementalHeatingCoil(suppHeatingCoil); + testObject.autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); auto testObjectClone = testObject.clone(m).cast(); From 34001c3a4be6273103253696c9a92a573020da47 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 21 Sep 2023 13:01:43 +0200 Subject: [PATCH 18/32] AirLoopHVAC:UnitarySystem: Make all 3 Supply Air Flow Rate Method fields required-field in the OpenStudio.idd --- resources/model/OpenStudio.idd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index fb2b16ebe12..fc793c75e50 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -11902,7 +11902,7 @@ OS:AirLoopHVAC:UnitarySystem, \key FlowPerFloorArea \key FractionOfAutosizedCoolingValue \key FlowPerCoolingCapacity - \default None + \required-field \note Enter the method used to determine the cooling supply air volume flow rate. \note None is used when a cooling coil is not included in the unitary system or this field may be blank. \note SupplyAirFlowRate is selected when the magnitude of the supply air volume is used. @@ -11947,7 +11947,7 @@ OS:AirLoopHVAC:UnitarySystem, \key FlowPerFloorArea \key FractionOfAutosizedHeatingValue \key FlowPerHeatingCapacity - \default None + \required-field \note Enter the method used to determine the heating supply air volume flow rate. \note None is used when a heating coil is not included in the unitary system or this field may be blank. \note SupplyAirFlowRate is selected when the magnitude of the supply air volume is used. @@ -11994,6 +11994,7 @@ OS:AirLoopHVAC:UnitarySystem, \key FractionOfAutosizedHeatingValue \key FlowPerCoolingCapacity \key FlowPerHeatingCapacity + \required-field \note Enter the method used to determine the supply air volume flow rate when no cooling or heating is required. \note None is used when a cooling and heating coil is not included in the unitary system or this field may be blank. \note SupplyAirFlowRate is selected when the magnitude of the supply air volume is used. From ff0573af332ab6fbe7814ff66963a103425bc95f Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 21 Sep 2023 13:18:42 +0200 Subject: [PATCH 19/32] Stub required-fields changes + add docstrings --- src/model/AirLoopHVACUnitarySystem.hpp | 80 ++++++++++++++++++-------- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/src/model/AirLoopHVACUnitarySystem.hpp b/src/model/AirLoopHVACUnitarySystem.hpp index a906a23c165..626f00c23fc 100644 --- a/src/model/AirLoopHVACUnitarySystem.hpp +++ b/src/model/AirLoopHVACUnitarySystem.hpp @@ -142,7 +142,7 @@ namespace model { boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation() const; /** In EnergyPlus 8.3.0 and above this property maps to the EnergyPlus field "No Load Supply Air Flow Rate Method" **/ - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; + std::string supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; /** In EnergyPlus 8.3.0 and above this property maps to the EnergyPlus field "No Load Supply Air Flow Rate" **/ boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired() const; @@ -244,16 +244,26 @@ namespace model { void resetSupplyAirFanOperatingModeSchedule(); + /** Sets the Heating Coil. If the "Supply Air Flow Rate Method During Heating Operation" was "None", switch to "SupplyAirFlowRate" + * and autosize the "Supply Air Flow Rate During Heating Operation" field */ bool setHeatingCoil(const HVACComponent& heatingCoil); + /** This will switch the "Supply Air Flow Rate Method During Heating Operation" to "None" and clear all heating flow fields + * If the Unitary is left with no coils, the "Supply Air Flow Rate Method When No Heating Or Cooling" is also set to None + * and all NoCoolHeat flow fields are reset */ void resetHeatingCoil(); bool setDXHeatingCoilSizingRatio(double dXHeatingCoilSizingRatio); void resetDXHeatingCoilSizingRatio(); + /** Sets the Cooling Coil. If the "Supply Air Flow Rate Method During Cooling Operation" was "None", switch to "SupplyAirFlowRate" + * and autosize the "Supply Air Flow Rate During Cooling Operation" field */ bool setCoolingCoil(const HVACComponent& coolingCoil); + /** This will switch the "Supply Air Flow Rate Method During Cooling Operation" to "None" and clear all cooling flow fields + * If the Unitary is left with no coils, the "Supply Air Flow Rate Method When No Heating Or Cooling" is also set to None + * and all NoCoolHeat flow fields are reset */ void resetCoolingCoil(); bool setUseDOASDXCoolingCoil(bool useDOASDXCoolingCoil); @@ -276,71 +286,93 @@ namespace model { void resetSupplementalHeatingCoil(); - OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringCoolingOperation(const std::string& supplyAirFlowRateMethodDuringCoolingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringCoolingOperation(); + // During Cooling + /** Sets the field and switches "Supply Air Flow Rate Method During Cooling Operation" (coolingSAFMethod) to "SupplyAirFlowRate" */ bool setSupplyAirFlowRateDuringCoolingOperation(double supplyAirFlowRateDuringCoolingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringCoolingOperation(); + /** Sets the field and switches the coolingSAFMethod to "SupplyAirFlowRate" */ void autosizeSupplyAirFlowRateDuringCoolingOperation(); + /** Sets the field and switches the coolingSAFMethod to "FlowPerFloorArea" */ bool setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(double supplyAirFlowRatePerFloorAreaDuringCoolingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); + /** Sets the field and switches the coolingSAFMethod to "FractionOfAutosizedCoolingValue" */ bool setFractionofAutosizedDesignCoolingSupplyAirFlowRate(double fractionofAutosizedDesignCoolingSupplyAirFlowRate); - OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); + /** Sets the field and switches the coolingSAFMethod to "FlowPerCoolingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation); + + OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringCoolingOperation(const std::string& supplyAirFlowRateMethodDuringCoolingOperation); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringCoolingOperation(); + + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringCoolingOperation(); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(); - OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringHeatingOperation(const std::string& supplyAirFlowRateMethodDuringHeatingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringHeatingOperation(); + // During Heating + /** Sets the field and switches "Supply Air Flow Rate Method During Heating Operation" (heatingSAFMethod) to "SupplyAirFlowRate" */ bool setSupplyAirFlowRateDuringHeatingOperation(double supplyAirFlowRateDuringHeatingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringHeatingOperation(); + /** Sets the field and switches the heatingSAFMethod to "SupplyAirFlowRate" */ void autosizeSupplyAirFlowRateDuringHeatingOperation(); + /** Sets the field and switches the heatingSAFMethod to "FlowPerFloorArea" */ bool setSupplyAirFlowRatePerFloorAreaduringHeatingOperation(double supplyAirFlowRatePerFloorAreaduringHeatingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaduringHeatingOperation(); + /** Sets the field and switches the heatingSAFMethod to "FractionOfAutosizedHeatingValue" */ bool setFractionofAutosizedDesignHeatingSupplyAirFlowRate(double fractionofAutosizedDesignHeatingSupplyAirFlowRate); - OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignHeatingSupplyAirFlowRate(); + /** Sets the field and switches the heatingSAFMethod to "FlowPerHeatingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation); + + OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringHeatingOperation(const std::string& supplyAirFlowRateMethodDuringHeatingOperation); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringHeatingOperation(); + + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringHeatingOperation(); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaduringHeatingOperation(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignHeatingSupplyAirFlowRate(); OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); - bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); + // When no Heating or Cooling is Required + // Sets the "Supply Air Flow Rate Method When No Cooling or Heating is Required" (noCoolHeatSAFMethod) to "None" and clears the NoCoolHeat flow rate fields void resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); + /** Sets the field and switches the noCoolHeatSAFMethod) to "SupplyAirFlowRate" */ bool setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(double supplyAirFlowRateWhenNoCoolingorHeatingisRequired); - - void resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "SupplyAirFlowRate" */ void autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + /** Sets the field and switches the noCoolHeatSAFMethod) to "FlowPerFloorArea" */ bool setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(double supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); - void resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FractionOfAutosizedCoolingValue" */ bool setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); - void resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FractionOfAutosizedHeatingValue" */ bool setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); - void resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FlowPerCoolingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); - void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FlowPerHeatingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); - void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& noCoolHeatMethod); + + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + // End SAF methods bool setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature); From 70ced9141c55fe3e6360f0b3d125df0b9e025fe9 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 21 Sep 2023 13:18:58 +0200 Subject: [PATCH 20/32] Cleanup impl + changes --- src/model/AirLoopHVACUnitarySystem_Impl.hpp | 32 ++++++++++----------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/model/AirLoopHVACUnitarySystem_Impl.hpp b/src/model/AirLoopHVACUnitarySystem_Impl.hpp index f56ba5209a7..3bdf6a4ffd3 100644 --- a/src/model/AirLoopHVACUnitarySystem_Impl.hpp +++ b/src/model/AirLoopHVACUnitarySystem_Impl.hpp @@ -134,7 +134,7 @@ namespace model { boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation() const; - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; + std::string supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired() const; @@ -222,7 +222,7 @@ namespace model { void resetControlType(); - bool setControllingZoneorThermostatLocation(const boost::optional& thermalZone); + bool setControllingZoneorThermostatLocation(const ThermalZone& thermalZone); void resetControllingZoneorThermostatLocation(); @@ -234,11 +234,11 @@ namespace model { void resetAvailabilitySchedule(); - bool setSupplyFan(const boost::optional& supplyFan); + bool setSupplyFan(const HVACComponent& supplyFan); void resetSupplyFan(); - bool setFanPlacement(boost::optional fanPlacement); + bool setFanPlacement(const std::string& fanPlacement); void resetFanPlacement(); @@ -272,7 +272,7 @@ namespace model { void resetLatentLoadControl(); - bool setSupplementalHeatingCoil(const boost::optional& supplementalHeatingCoil); + bool setSupplementalHeatingCoil(const HVACComponent& supplementalHeatingCoil); void resetSupplementalHeatingCoil(); @@ -318,43 +318,41 @@ namespace model { void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); - bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); + bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); void resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); - bool setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired); + bool setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(double supplyAirFlowRateWhenNoCoolingorHeatingisRequired); void resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); void autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - bool setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); + bool setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(double supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); void resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); bool setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); void resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); bool setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); void resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); + double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); + double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); - bool setMaximumSupplyAirTemperature(boost::optional maximumSupplyAirTemperature); + bool setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature); void resetMaximumSupplyAirTemperature(); @@ -364,7 +362,7 @@ namespace model { void resetMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(); - bool setOutdoorDryBulbTemperatureSensorNodeName(boost::optional outdoorDryBulbTemperatureSensorNodeName); + bool setOutdoorDryBulbTemperatureSensorNodeName(const std::string& outdoorDryBulbTemperatureSensorNodeName); void resetOutdoorDryBulbTemperatureSensorNodeName(); @@ -400,7 +398,7 @@ namespace model { // void resetMaximumTemperatureforHeatRecovery(); - bool setDesignSpecificationMultispeedObject(const boost::optional& unitarySystemPerformace); + bool setDesignSpecificationMultispeedObject(const UnitarySystemPerformanceMultispeed& unitarySystemPerformace); void resetDesignSpecificationMultispeedObject(); From 2bad678737339e792ecc9cb2f7f57cc5c2013a1a Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 21 Sep 2023 13:19:20 +0200 Subject: [PATCH 21/32] Implement required-field changes --- src/model/AirLoopHVACUnitarySystem.cpp | 497 +++++++++++++------------ 1 file changed, 259 insertions(+), 238 deletions(-) diff --git a/src/model/AirLoopHVACUnitarySystem.cpp b/src/model/AirLoopHVACUnitarySystem.cpp index 83d74760264..314768df1e6 100644 --- a/src/model/AirLoopHVACUnitarySystem.cpp +++ b/src/model/AirLoopHVACUnitarySystem.cpp @@ -24,7 +24,8 @@ #include "../utilities/core/Assert.hpp" #include "../utilities/data/DataEnums.hpp" -#include "utilities/core/Exception.hpp" +#include "../utilities/core/Compare.hpp" +#include "../utilities/core/Exception.hpp" #include #include @@ -88,23 +89,22 @@ namespace model { } std::vector AirLoopHVACUnitarySystem_Impl::getScheduleTypeKeys(const Schedule& schedule) const { - // TODO: Check schedule display names. std::vector result; - UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); - UnsignedVector::const_iterator b(fieldIndices.begin()); - UnsignedVector::const_iterator e(fieldIndices.end()); + const UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + const auto b = fieldIndices.cbegin(); + const auto e = fieldIndices.cend(); if (std::find(b, e, OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName) != e) { - result.push_back(ScheduleTypeKey("AirLoopHVACUnitarySystem", "Availability")); + result.emplace_back("AirLoopHVACUnitarySystem", "Availability"); } if (std::find(b, e, OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName) != e) { - result.push_back(ScheduleTypeKey("AirLoopHVACUnitarySystem", "Supply Air Fan Operating Mode")); + result.emplace_back("AirLoopHVACUnitarySystem", "Supply Air Fan Operating Mode"); } return result; } ModelObject AirLoopHVACUnitarySystem_Impl::clone(Model model) const { // Mimic what StraightComponent_Impl::clone would do (we inherit ZoneHVACComponent here...) - auto modelObjectClone = ModelObject_Impl::clone(model).cast(); + auto modelObjectClone = ModelObject_Impl::clone(model).cast(); // NOLINT(bugprone-parent-virtual-call) modelObjectClone.setString(modelObjectClone.inletPort(), ""); modelObjectClone.setString(modelObjectClone.outletPort(), ""); @@ -433,9 +433,11 @@ namespace model { return getDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation, true); } - boost::optional AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { - // No default, and return uninitialized if empty - return getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, false, true); + std::string AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { + boost::optional value = + getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, true); + OS_ASSERT(value); + return value.get(); } boost::optional AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateWhenNoCoolingorHeatingisRequired() const { @@ -593,91 +595,74 @@ namespace model { } bool AirLoopHVACUnitarySystem_Impl::setControlType(const std::string& controlType) { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, controlType); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, controlType); return result; } void AirLoopHVACUnitarySystem_Impl::resetControlType() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setControllingZoneorThermostatLocation(const boost::optional& thermalZone) { - bool result(false); - if (thermalZone) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, thermalZone.get().handle()); - } else { - resetControllingZoneorThermostatLocation(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setControllingZoneorThermostatLocation(const ThermalZone& thermalZone) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, thermalZone.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetControllingZoneorThermostatLocation() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDehumidificationControlType(const std::string& dehumidificationControlType) { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, dehumidificationControlType); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, dehumidificationControlType); return result; } void AirLoopHVACUnitarySystem_Impl::resetDehumidificationControlType() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setAvailabilitySchedule(Schedule& schedule) { - bool result = setSchedule(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, "AirLoopHVACUnitarySystem", "Availability", schedule); + const bool result = + setSchedule(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, "AirLoopHVACUnitarySystem", "Availability", schedule); return result; } void AirLoopHVACUnitarySystem_Impl::resetAvailabilitySchedule() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setSupplyFan(const boost::optional& supplyFan) { - bool result(false); - if (supplyFan) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, supplyFan.get().handle()); - } else { - resetSupplyFan(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setSupplyFan(const HVACComponent& supplyFan) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, supplyFan.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplyFan() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setFanPlacement(boost::optional fanPlacement) { - bool result(false); - if (fanPlacement) { - result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, fanPlacement.get()); - } else { - resetFanPlacement(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setFanPlacement(const std::string& fanPlacement) { + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, fanPlacement); return result; } void AirLoopHVACUnitarySystem_Impl::resetFanPlacement() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFanOperatingModeSchedule(Schedule& schedule) { - bool result = setSchedule(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, "AirLoopHVACUnitarySystem", - "Supply Air Fan Operating Mode", schedule); + const bool result = setSchedule(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, "AirLoopHVACUnitarySystem", + "Supply Air Fan Operating Mode", schedule); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFanOperatingModeSchedule() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, ""); OS_ASSERT(result); } @@ -698,15 +683,24 @@ namespace model { resetSupplyAirFlowRatePerFloorAreaduringHeatingOperation(); resetFractionofAutosizedDesignHeatingSupplyAirFlowRate(); resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); + if (!hasCoolingCoil()) { + setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + } } bool AirLoopHVACUnitarySystem_Impl::setDXHeatingCoilSizingRatio(double dXHeatingCoilSizingRatio) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, dXHeatingCoilSizingRatio); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, dXHeatingCoilSizingRatio); return result; } void AirLoopHVACUnitarySystem_Impl::resetDXHeatingCoilSizingRatio() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, ""); OS_ASSERT(result); } @@ -727,6 +721,15 @@ namespace model { resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(); + if (!hasHeatingCoil()) { + setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + } } bool AirLoopHVACUnitarySystem_Impl::setUseDOASDXCoolingCoil(bool useDOASDXCoolingCoil) { @@ -734,49 +737,43 @@ namespace model { } void AirLoopHVACUnitarySystem_Impl::resetUseDOASDXCoolingCoil() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::UseDOASDXCoolingCoil, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::UseDOASDXCoolingCoil, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDOASDXCoolingCoilLeavingMinimumAirTemperature(double dOASDXCoolingCoilLeavingMinimumAirTemperature) { - bool result = + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, dOASDXCoolingCoilLeavingMinimumAirTemperature); return result; } void AirLoopHVACUnitarySystem_Impl::resetDOASDXCoolingCoilLeavingMinimumAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, ""); OS_ASSERT(result); } void AirLoopHVACUnitarySystem_Impl::autosizeDOASDXCoolingCoilLeavingMinimumAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, "Autosize"); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, "Autosize"); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setLatentLoadControl(const std::string& latentLoadControl) { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, latentLoadControl); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, latentLoadControl); return result; } void AirLoopHVACUnitarySystem_Impl::resetLatentLoadControl() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setSupplementalHeatingCoil(const boost::optional& supplementalHeatingCoil) { - bool result(false); - if (supplementalHeatingCoil) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, supplementalHeatingCoil.get().handle()); - } else { - resetSupplementalHeatingCoil(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setSupplementalHeatingCoil(const HVACComponent& supplementalHeatingCoil) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, supplementalHeatingCoil.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplementalHeatingCoil() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, ""); OS_ASSERT(result); } @@ -949,304 +946,318 @@ namespace model { } bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { - result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, - supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired.get()); - } else { - resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); - result = true; - } + const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, + supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, "None"); OS_ASSERT(result); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); } - bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (supplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, - supplyAirFlowRateWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - result = true; + bool + AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(double supplyAirFlowRateWhenNoCoolingorHeatingisRequired) { + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, + supplyAirFlowRateWhenNoCoolingorHeatingisRequired); + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate")); + // resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } void AirLoopHVACUnitarySystem_Impl::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, "Autosize"); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, "Autosize"); OS_ASSERT(result); + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate")); + // resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); } bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, - supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerFloorArea"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); - result = true; + double supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired) { + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, + supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerFloorArea")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + // resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, - fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedCoolingValue"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - result = true; + double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, + fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedCoolingValue")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + // resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, - fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedHeatingValue"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - result = true; + double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, + fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedHeatingValue")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + // resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { - result = setDouble( - OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, - designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerCoolingCapacity"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); - result = true; + double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, + designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerCoolingCapacity")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + // resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired() { - bool result = setString( + const bool result = setString( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { - result = setDouble( - OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired, - designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerHeatingCapacity"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); - result = true; + double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired, + designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerHeatingCapacity")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + // resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired() { - bool result = setString( + const bool result = setString( OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setMaximumSupplyAirTemperature(boost::optional maximumSupplyAirTemperature) { - bool result(false); - if (maximumSupplyAirTemperature) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, maximumSupplyAirTemperature.get()); - } else { - resetMaximumSupplyAirTemperature(); - result = true; - } - OS_ASSERT(result); + bool AirLoopHVACUnitarySystem_Impl::setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature) { + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, maximumSupplyAirTemperature); return result; } void AirLoopHVACUnitarySystem_Impl::resetMaximumSupplyAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, ""); OS_ASSERT(result); } void AirLoopHVACUnitarySystem_Impl::autosizeMaximumSupplyAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, "Autosize"); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, "Autosize"); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation( double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, - maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); - OS_ASSERT(result); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, + maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); return result; } void AirLoopHVACUnitarySystem_Impl::resetMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setOutdoorDryBulbTemperatureSensorNodeName( - boost::optional outdoorDryBulbTemperatureSensorNodeName) { - bool result(false); - if (outdoorDryBulbTemperatureSensorNodeName) { - result = - setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, outdoorDryBulbTemperatureSensorNodeName.get()); - } else { - resetOutdoorDryBulbTemperatureSensorNodeName(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setOutdoorDryBulbTemperatureSensorNodeName(const std::string& outdoorDryBulbTemperatureSensorNodeName) { + const bool result = + setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, outdoorDryBulbTemperatureSensorNodeName); OS_ASSERT(result); return result; } void AirLoopHVACUnitarySystem_Impl::resetOutdoorDryBulbTemperatureSensorNodeName() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setMaximumCyclingRate(double maximumCyclingRate) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumCyclingRate, maximumCyclingRate); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumCyclingRate, maximumCyclingRate); return result; } void AirLoopHVACUnitarySystem_Impl::resetMaximumCyclingRate() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumCyclingRate, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumCyclingRate, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setHeatPumpTimeConstant(double heatPumpTimeConstant) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpTimeConstant, heatPumpTimeConstant); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpTimeConstant, heatPumpTimeConstant); return result; } void AirLoopHVACUnitarySystem_Impl::resetHeatPumpTimeConstant() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpTimeConstant, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpTimeConstant, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setFractionofOnCyclePowerUse(double fractionofOnCyclePowerUse) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofOnCyclePowerUse, fractionofOnCyclePowerUse); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofOnCyclePowerUse, fractionofOnCyclePowerUse); return result; } void AirLoopHVACUnitarySystem_Impl::resetFractionofOnCyclePowerUse() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FractionofOnCyclePowerUse, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FractionofOnCyclePowerUse, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setHeatPumpFanDelayTime(double heatPumpFanDelayTime) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpFanDelayTime, heatPumpFanDelayTime); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpFanDelayTime, heatPumpFanDelayTime); return result; } void AirLoopHVACUnitarySystem_Impl::resetHeatPumpFanDelayTime() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpFanDelayTime, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::HeatPumpFanDelayTime, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setAncilliaryOnCycleElectricPower(double ancilliaryOnCycleElectricPower) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ancilliaryOnCycleElectricPower); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ancilliaryOnCycleElectricPower); return result; } void AirLoopHVACUnitarySystem_Impl::resetAncilliaryOnCycleElectricPower() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setAncilliaryOffCycleElectricPower(double ancilliaryOffCycleElectricPower) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ancilliaryOffCycleElectricPower); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ancilliaryOffCycleElectricPower); return result; } void AirLoopHVACUnitarySystem_Impl::resetAncilliaryOffCycleElectricPower() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ""); OS_ASSERT(result); } // bool AirLoopHVACUnitarySystem_Impl::setDesignHeatRecoveryWaterFlowRate(double designHeatRecoveryWaterFlowRate) { - // bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, designHeatRecoveryWaterFlowRate); + // const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, designHeatRecoveryWaterFlowRate); // return result; // } // void AirLoopHVACUnitarySystem_Impl::resetDesignHeatRecoveryWaterFlowRate() { - // bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, ""); + // const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, ""); // OS_ASSERT(result); // } // bool AirLoopHVACUnitarySystem_Impl::setMaximumTemperatureforHeatRecovery(double maximumTemperatureforHeatRecovery) { - // bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, maximumTemperatureforHeatRecovery); + // const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, maximumTemperatureforHeatRecovery); // return result; // } // void AirLoopHVACUnitarySystem_Impl::resetMaximumTemperatureforHeatRecovery() { - // bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, ""); + // const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, ""); // OS_ASSERT(result); // } - bool AirLoopHVACUnitarySystem_Impl::setDesignSpecificationMultispeedObject( - const boost::optional& unitarySystemPerformace) { - bool result(false); - if (unitarySystemPerformace) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, unitarySystemPerformace.get().handle()); - } else { - resetDesignSpecificationMultispeedObject(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setDesignSpecificationMultispeedObject(const UnitarySystemPerformanceMultispeed& unitarySystemPerformace) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, unitarySystemPerformace.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetDesignSpecificationMultispeedObject() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, ""); OS_ASSERT(result); } @@ -1391,7 +1402,7 @@ namespace model { OS_ASSERT(ok); getImpl()->setSupplyAirFlowRateMethodDuringCoolingOperation("None"); getImpl()->setSupplyAirFlowRateMethodDuringHeatingOperation("None"); - setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); + getImpl()->setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); setMaximumSupplyAirTemperature(80.0); setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(21.0); ok = setMaximumCyclingRate(2.5); @@ -1577,7 +1588,7 @@ namespace model { return getImpl()->designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); } - boost::optional AirLoopHVACUnitarySystem::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { + std::string AirLoopHVACUnitarySystem::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { return getImpl()->supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); } @@ -1871,12 +1882,6 @@ namespace model { designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation); } - bool AirLoopHVACUnitarySystem::setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { - return getImpl()->setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } - void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() { getImpl()->resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); } @@ -1886,10 +1891,6 @@ namespace model { supplyAirFlowRateWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - getImpl()->resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - } - void AirLoopHVACUnitarySystem::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { getImpl()->autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); } @@ -1900,30 +1901,18 @@ namespace model { supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired() { - getImpl()->resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { return getImpl()->setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - getImpl()->resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { return getImpl()->setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - getImpl()->resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { return getImpl() @@ -1931,11 +1920,6 @@ namespace model { designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired() { - getImpl() - ->resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { return getImpl() @@ -1943,11 +1927,6 @@ namespace model { designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired() { - getImpl() - ->resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature) { return getImpl()->setMaximumSupplyAirTemperature(maximumSupplyAirTemperature); } @@ -2157,6 +2136,48 @@ namespace model { "setSupplyAirFlowRatePerFloorAreaduringHeatingOperation, or setFractionofAutosizedDesignHeatingSupplyAirFlowRate instead."); } + bool AirLoopHVACUnitarySystem::setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& noCoolHeatMethod) { + // setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired + DEPRECATED_AT_MSG(3, 7, 0, + "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired For 'None', one of the flow rate setters otherwise."); + + if (openstudio::istringEqual("None", noCoolHeatMethod)) { + resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); + return true; + } + return false; + } + + void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + /// @endcond } // namespace model From 717a91ec605722ca38eb6f2e391ac12d5c2d0d45 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 21 Sep 2023 13:19:49 +0200 Subject: [PATCH 22/32] Start VT for the UnitarySystem required-field (this will conflict with the IOFreeze branch) --- src/osversion/VersionTranslator.cpp | 207 ++++++++++++++++++++++++++++ src/utilities/core/ASCIIStrings.hpp | 11 ++ 2 files changed, 218 insertions(+) diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index 74567e4c2d7..35d447eb14f 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -34,6 +34,7 @@ #include "../utilities/math/FloatCompare.hpp" #include "../utilities/idf/IdfObject_Impl.hpp" #include "../utilities/core/UUID.hpp" +#include "../utilities/core/ASCIIStrings.hpp" #include #include @@ -7664,6 +7665,212 @@ namespace osversion { ss << ghxObject; ss << kusudaObject; + } else if (iddname == "OS:AirLoopHVAC:UnitarySystem") { + + // NOTE: With 23.2.0-IOFreeze, we always have a change anyways cause some fields were removed + + auto iddObject = idd_3_7_0.getObject(iddname); + IdfObject newObject(iddObject.get()); + + for (size_t i = 0; i < object.numFields(); ++i) { + if ((value = object.getString(i))) { + newObject.setString(i, value.get()); + } + } + + // * 11 - Heating Coil Name + constexpr unsigned heatingCoilNameIndex = 11; + const bool hasHeatingCoil = !object.isEmpty(heatingCoilNameIndex); + + // * 13 - Cooling Coil Name + constexpr unsigned coolingCoilNameIndex = 13; + const bool hasCoolingCoil = !object.isEmpty(coolingCoilNameIndex); + + // We use getString(idx, false, true) to not get default, returned unitialized empty + + // * 18 - Supply Air Flow Rate Method During Cooling Operation + constexpr unsigned coolingSAFMethodIndex = 18; + boost::optional coolingSAFMethod = object.getString(coolingSAFMethodIndex, false, true); + + // * 23 - Supply Air Flow Rate Method During Heating Operation + constexpr unsigned heatingSAFMethodIndex = 23; + boost::optional heatingSAFMethod = object.getString(heatingSAFMethodIndex, false, true); + + // * 28 - Supply Air Flow Rate Method When No Cooling or Heating is Required + constexpr unsigned noCoolHeatSAFMethodIndex = 28; + boost::optional noCoolHeatSAFMethod = object.getString(noCoolHeatSAFMethodIndex, false, true); + + constexpr std::array coolingSAFMethodChoices{"SupplyAirFlowRate", "FlowPerFloorArea", "FractionOfAutosizedCoolingValue", + "FlowPerCoolingCapacity"}; + + constexpr std::array coolingSAFMethodChoicesUC{"SUPPLYAIRFLOWRATE", "FLOWPERFLOORAREA", + "FRACTIONOFAUTOSIZEDCOOLINGVALUE", "FLOWPERCOOLINGCAPACITY"}; + + constexpr std::array heatingSAFMethodChoices{"SupplyAirFlowRate", "FlowPerFloorArea", "FractionOfAutosizedHeatingValue", + "FlowPerHeatingCapacity"}; + constexpr std::array heatingSAFMethodChoicesUC{"SUPPLYAIRFLOWRATE", "FLOWPERFLOORAREA", + "FRACTIONOFAUTOSIZEDHEATINGVALUE", "FLOWPERHEATINGCAPACITY"}; + + constexpr std::array noCoolHeatSAFMethodChoices{ + "SupplyAirFlowRate", "FlowPerFloorArea", "FractionOfAutosizedCoolingValue", "FractionOfAutosizedHeatingValue", + "FlowPerCoolingCapacity", "FlowPerHeatingCapacity"}; + + constexpr std::array noCoolHeatSAFMethodChoicesUC{ + "SUPPLYAIRFLOWRATE", "FLOWPERFLOORAREA", "FRACTIONOFAUTOSIZEDCOOLINGVALUE", "FRACTIONOFAUTOSIZEDHEATINGVALUE", + "FLOWPERCOOLINGCAPACITY", "FLOWPERHEATINGCAPACITY"}; + + // Reset all flow fields, we want only one at best to be set + for (size_t i = 0; i < coolingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = coolingSAFMethodIndex + 1 + i; + newObject.setString(fieldIndex, ""); + } + for (size_t i = 0; i < heatingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = heatingSAFMethodIndex + 1 + i; + newObject.setString(fieldIndex, ""); + } + for (size_t i = 0; i < noCoolHeatSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = noCoolHeatSAFMethodIndex + 1 + i; + newObject.setString(fieldIndex, ""); + } + + if (!hasCoolingCoil) { + newObject.setString(coolingSAFMethodIndex, "None"); + } else if (!coolingSAFMethod) { + // Technically here E+ checks if the cooling coil rated air flow rate is autosized or not + // Also could get overriden by the DesignSpecification:ZoneHVAC:Sizing + // Finally it lets it slide as long as one of the other SupplyAirFlowRateXXX is not empty + // Here I guess we'll scan the fields in order, and pick the first we find + // * 19 - Supply Air Flow Rate During Cooling Operation + // * 20 - Supply Air Flow Rate Per Floor Area During Cooling Operation + // * 21 - Fraction of Autosized Design Cooling Supply Air Flow Rate + // * 22 - Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation + bool found = false; + for (size_t i = 0; i < coolingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = coolingSAFMethodIndex + 1 + i; + if ((value = object.getString(fieldIndex))) { + newObject.setString(coolingSAFMethodIndex, std::string{coolingSAFMethodChoices[i]}); + newObject.setString(fieldIndex, *value); + found = true; + break; + } + } + if (!found) { + LOG(Warn, "For " << object.briefDescription() + << ", there is a cooling coil, but no Supply Air Flow Rate Method During Cooling Operation and no flow rate fields set. " + "Defaulting to SupplyAirFlowRate with Autosize"); + newObject.setString(coolingSAFMethodIndex, "SupplyAirFlowRate"); + newObject.setString(coolingSAFMethodIndex + 1, "Autosize"); + } + } else { + std::string coolingSAFMethodUC = ascii_to_upper_copy(*coolingSAFMethod); + auto it = std::find_if(coolingSAFMethodChoicesUC.cbegin(), coolingSAFMethodChoicesUC.cend(), + [&coolingSAFMethodUC](auto& s) { return s == coolingSAFMethodUC; }); + if (it == coolingSAFMethodChoicesUC.cend()) { + LOG(Error, + "For " << object.briefDescription() << ", Unrecognized Supply Air Flow Method Rate During Cooling Operation=" << *coolingSAFMethod); + } else { + auto index = std::distance(coolingSAFMethodChoicesUC.cbegin(), it); + if ((value == object.getString(index))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For " << object.briefDescription() << ", Supply Air Flow Method Rate During Cooling Operation is '" << *coolingSAFMethod + << "' but associated field is empty"); + } + } + } + + if (!hasHeatingCoil) { + newObject.setString(heatingSAFMethodIndex, "None"); + } else if (!heatingSAFMethod) { + + // * 23 - Supply Air Flow Rate Method During Heating Operation + // * 24 - Supply Air Flow Rate During Heating Operation + // * 25 - Supply Air Flow Rate Per Floor Area during Heating Operation + // * 26 - Fraction of Autosized Design Heating Supply Air Flow Rate + // * 27 - Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation + bool found = false; + for (size_t i = 0; i < heatingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = heatingSAFMethodIndex + 1 + i; + if ((value = object.getString(fieldIndex))) { + newObject.setString(heatingSAFMethodIndex, std::string{heatingSAFMethodChoices[i]}); + newObject.setString(fieldIndex, *value); + found = true; + break; + } + } + if (!found) { + LOG(Warn, "For " << object.briefDescription() + << ", there is a heating coil, but no Supply Air Flow Rate Method During Heating Operation and no flow rate fields set. " + "Defaulting to SupplyAirFlowRate with Autosize"); + newObject.setString(heatingSAFMethodIndex, "SupplyAirFlowRate"); + newObject.setString(heatingSAFMethodIndex + 1, "Autosize"); + } + } else { + std::string heatingSAFMethodUC = ascii_to_upper_copy(*heatingSAFMethod); + auto it = std::find_if(heatingSAFMethodChoicesUC.cbegin(), heatingSAFMethodChoicesUC.cend(), + [&heatingSAFMethodUC](auto& s) { return s == heatingSAFMethodUC; }); + if (it == heatingSAFMethodChoicesUC.cend()) { + LOG(Error, + "For " << object.briefDescription() << ", Unrecognized Supply Air Flow Method Rate During Heating Operation=" << *heatingSAFMethod); + } else { + auto index = std::distance(heatingSAFMethodChoicesUC.cbegin(), it); + if ((value == object.getString(index))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For " << object.briefDescription() << ", Supply Air Flow Method Rate During Heating Operation is '" << *heatingSAFMethod + << "' but associated field is empty"); + } + } + } + + if (!hasHeatingCoil && !hasCoolingCoil) { + // TODO: not sure here + newObject.setString(noCoolHeatSAFMethodIndex, "None"); + } else if (!noCoolHeatSAFMethod) { + + // * 29 - Supply Air Flow Rate When No Cooling or Heating is Required + // * 30 - Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required + // * 31 - Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + // * 32 - Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + // * 33 - Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required + // * 34 - Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required + bool found = false; + for (size_t i = 0; i < noCoolHeatSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = noCoolHeatSAFMethodIndex + 1 + i; + if ((value = object.getString(fieldIndex))) { + newObject.setString(noCoolHeatSAFMethodIndex, std::string{noCoolHeatSAFMethodChoices[i]}); + newObject.setString(fieldIndex, *value); + found = true; + break; + } + } + if (!found) { + LOG(Warn, "For " << object.briefDescription() + << ", there is no Supply Air Flow Rate Method When No Cooling or Heating is Required and no flow rate fields set. " + "Defaulting to None"); + newObject.setString(noCoolHeatSAFMethodIndex, "None"); + } + } else { + std::string noCoolHeatSAFMethodUC = ascii_to_upper_copy(*noCoolHeatSAFMethod); + auto it = std::find_if(noCoolHeatSAFMethodChoicesUC.cbegin(), noCoolHeatSAFMethodChoicesUC.cend(), + [&noCoolHeatSAFMethodUC](auto& s) { return s == noCoolHeatSAFMethodUC; }); + if (it == noCoolHeatSAFMethodChoicesUC.cend()) { + LOG(Error, "For " << object.briefDescription() + << ", Unrecognized Supply Air Flow Rate Method When No Cooling or Heating is Required=" << *noCoolHeatSAFMethod); + } else { + auto index = std::distance(noCoolHeatSAFMethodChoicesUC.cbegin(), it); + if ((value == object.getString(index))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For " << object.briefDescription() << ", Supply Air Flow Rate Method When No Cooling or Heating is Required is '" + << *noCoolHeatSAFMethod << "' but associated field is empty"); + } + } + } + + ss << newObject; + m_refactored.emplace_back(std::move(object), std::move(newObject)); + // No-op } else { ss << object; diff --git a/src/utilities/core/ASCIIStrings.hpp b/src/utilities/core/ASCIIStrings.hpp index 9d7a48f27a3..3cc0a0ef602 100644 --- a/src/utilities/core/ASCIIStrings.hpp +++ b/src/utilities/core/ASCIIStrings.hpp @@ -22,6 +22,17 @@ inline std::string ascii_to_lower_copy(std::string_view input) { return result; } +inline std::string ascii_to_upper_copy(std::string_view input) { + std::string result{input}; + constexpr auto to_upper_diff = 'A' - 'a'; + for (auto& c : result) { + if (c >= 'a' && c <= 'z') { + c += to_upper_diff; + } + } + return result; +} + inline std::string_view ascii_trim_left(std::string_view s) { return s.substr(std::min(s.find_first_not_of(" \f\n\r\t\v"), s.size())); } From 42e6512ac10f09253f65e1232efec0a24d776334 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 21 Sep 2023 15:48:48 +0200 Subject: [PATCH 23/32] Add Gtest and FT update --- ...rwardTranslateAirLoopHVACUnitarySystem.cpp | 6 +- .../test/AirLoopHVACUnitarySystem_GTest.cpp | 129 +++++++++++++++++- 2 files changed, 128 insertions(+), 7 deletions(-) diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp index e087090796b..fa850bf949f 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp @@ -309,10 +309,8 @@ namespace energyplus { } // Supply Air Flow Rate Method When No Cooling or Heating is Required - s = modelObject.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); - if (s) { - unitarySystem.setString(AirLoopHVAC_UnitarySystemFields::NoLoadSupplyAirFlowRateMethod, s.get()); - } + unitarySystem.setString(AirLoopHVAC_UnitarySystemFields::NoLoadSupplyAirFlowRateMethod, + modelObject.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); // Supply Air Flow Rate When No Cooling or Heating is Required if (modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()) { diff --git a/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp b/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp index a9f2461a00f..8c4e030f828 100644 --- a/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp +++ b/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp @@ -719,8 +719,8 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOpera EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation()); // Setting a coil changes things - CoilHeatingDXSingleSpeed cc(m); - EXPECT_TRUE(unitary.setHeatingCoil(cc)); + CoilHeatingDXSingleSpeed hc(m); + EXPECT_TRUE(unitary.setHeatingCoil(hc)); EXPECT_EQ("SupplyAirFlowRate", unitary.supplyAirFlowRateMethodDuringHeatingOperation()); EXPECT_TRUE(unitary.isSupplyAirFlowRateDuringHeatingOperationAutosized()); EXPECT_FALSE(unitary.supplyAirFlowRateDuringHeatingOperation()); @@ -736,7 +736,7 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOpera EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRate()); EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation()); // Put it back - EXPECT_TRUE(unitary.setHeatingCoil(cc)); + EXPECT_TRUE(unitary.setHeatingCoil(hc)); // SupplyAirFlowRate EXPECT_TRUE(unitary.setSupplyAirFlowRateDuringHeatingOperation(1.0)); @@ -779,6 +779,129 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOpera EXPECT_EQ(1.0, unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation().get()); } +TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOperation_NoCoolHeat) { + // Test for #4695 - AirLoopHVACUnitarySystem: Supply Air Flow Rate Method During Operation should be set via related setters/autosize + + Model m; + AirLoopHVACUnitarySystem unitary = AirLoopHVACUnitarySystem(m); + CoilCoolingDXSingleSpeed cc(m); + EXPECT_TRUE(unitary.setCoolingCoil(cc)); + CoilHeatingDXSingleSpeed hc(m); + EXPECT_TRUE(unitary.setHeatingCoil(hc)); + + EXPECT_EQ("None", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("SupplyAirFlowRate", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + ASSERT_TRUE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerFloorArea", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + unitary.autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + EXPECT_EQ("SupplyAirFlowRate", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_TRUE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FractionOfAutosizedCoolingValue", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FractionOfAutosizedHeatingValue", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerCoolingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerHeatingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired().get()); + + // Reset both coils => back to None + unitary.resetHeatingCoil(); + EXPECT_EQ("FlowPerHeatingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + + unitary.resetCoolingCoil(); + EXPECT_EQ("None", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setHeatingCoil(hc)); + EXPECT_TRUE(unitary.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerHeatingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + unitary.resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); + EXPECT_EQ("None", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); +} + TEST_F(ModelFixture, AirLoopHVACUnitarySystem_needToRemoveDeprecated) { Model m; AirLoopHVACUnitarySystem unitary = AirLoopHVACUnitarySystem(m); From debaee403754ad11bbf612970c36d511e8fe1c4b Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 21 Sep 2023 16:52:26 +0200 Subject: [PATCH 24/32] Update VT: When "No Load Method" is blank, that's defnitely like "None" all the time --- src/osversion/VersionTranslator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index 35d447eb14f..1f10f3dd1b5 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -7828,6 +7828,9 @@ namespace osversion { newObject.setString(noCoolHeatSAFMethodIndex, "None"); } else if (!noCoolHeatSAFMethod) { + // Blank is equivalent to None here, no question + newObject.setString(noCoolHeatSAFMethodIndex, "None"); +#if 0 // * 29 - Supply Air Flow Rate When No Cooling or Heating is Required // * 30 - Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required // * 31 - Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required @@ -7850,6 +7853,7 @@ namespace osversion { "Defaulting to None"); newObject.setString(noCoolHeatSAFMethodIndex, "None"); } +#endif } else { std::string noCoolHeatSAFMethodUC = ascii_to_upper_copy(*noCoolHeatSAFMethod); auto it = std::find_if(noCoolHeatSAFMethodChoicesUC.cbegin(), noCoolHeatSAFMethodChoicesUC.cend(), From 2589657e485cc59ec30c1c8de8111c6ceda16d4f Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 22 Sep 2023 15:19:35 +0200 Subject: [PATCH 25/32] Write extensive VT tests (using a python script this time!) --- .../3_7_0/test_vt_UnitarySystem_SAFMethods.py | 175 ++++++++++ ...UnitarySystem_SAFMethods_CorrectCombos.osm | 320 ++++++++++++++++++ ...itarySystem_SAFMethods_IncorrectCombos.osm | 320 ++++++++++++++++++ ...st_vt_UnitarySystem_SAFMethods_default.osm | 320 ++++++++++++++++++ .../test/VersionTranslator_GTest.cpp | 198 +++++++++++ 5 files changed, 1333 insertions(+) create mode 100644 src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py create mode 100644 src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm create mode 100644 src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm create mode 100644 src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py new file mode 100644 index 00000000000..43fd7ebb209 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py @@ -0,0 +1,175 @@ +import openstudio + +FIELD_IDENTIFIERS = [ + "CoolingSAFMethod", + "CoolingSAFMethod_SAFlow", + "CoolingSAFMethod_SAFlowPerFloorArea", + "CoolingSAFMethod_FracOfAutosizedCoolingSAFlow", + "CoolingSAFMethod_FlowPerCoolingCapacity", + "HeatingSAFMethod", + "HeatingSAFMethod_SAFlow", + "HeatingSAFMethod_SAFlowPerFloorArea", + "HeatingSAFMethod_FracOfAutosizedHeatingSAFlow", + "HeatingSAFMethod_FlowPerHeatingCapacity", + "NoCoolHeatSAFMethod", + "NoCoolHeatSAFMethod_SAFlow", + "NoCoolHeatSAFMethod_SAFlowPerFloorArea", + "NoCoolHeatSAFMethod_FracOfAutosizedCoolingSAFlow", + "NoCoolHeatSAFMethod_FracOfAutosizedHeatingSAFlow", + "NoCoolHeatSAFMethod_FlowPerCoolingCapacity", + "NoCoolHeatSAFMethod_FlowPerHeatingCapacity", +] + +COOLINGSAFMETHODINDEX = 18 + + +def get_info(unitary): + return { + field_identifier: unitary.getString(i + COOLINGSAFMETHODINDEX, False, False).get() + for i, field_identifier in enumerate(FIELD_IDENTIFIERS) + } + + +def add_cooling_coil(unitary: openstudio.model.AirLoopHVACUnitarySystem, model: openstudio.model.Model): + cc = openstudio.model.CoilCoolingDXSingleSpeed(model) + assert unitary.setCoolingCoil(cc) + + +def add_heating_coil(unitary: openstudio.model.AirLoopHVACUnitarySystem, model: openstudio.model.Model): + hc = openstudio.model.CoilHeatingDXSingleSpeed(model) + assert unitary.setHeatingCoil(hc) + + +def apply_coils_or_not(m: openstudio.model.Model, prefix: str): + coil_methods = [None, add_cooling_coil, add_heating_coil] + + unitarys = m.getAirLoopHVACUnitarySystems() + assert len(unitarys) == 3 + + test_infos = [] + + for coil_method, u in zip(coil_methods, unitarys): + coil_method_name = "None" + has_cc = False + has_hc = False + if coil_method is not None: + coil_method(unitary=u, model=m) + coil_method_name = coil_method.__name__ + if coil_method_name == "add_cooling_coil": + has_cc = True + else: + has_hc = True + + test_case = f"{prefix} - {coil_method_name}" + u.setName(test_case) + print(test_case) + coolingSAFMethod = "" + heatingSAFMethod = "" + noCoolHeatSAFMethod = "" + if (coolingSAFMethod_ := u.supplyAirFlowRateMethodDuringCoolingOperation()).is_initialized(): + coolingSAFMethod = coolingSAFMethod_.get() + + if (heatingSAFMethod_ := u.supplyAirFlowRateMethodDuringHeatingOperation()).is_initialized(): + heatingSAFMethod = heatingSAFMethod_.get() + + if (noCoolHeatSAFMethod_ := u.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()).is_initialized(): + noCoolHeatSAFMethod = noCoolHeatSAFMethod_.get() + + test_infos.append( + dict( + { + "test_case": test_case, + "CC": has_cc, + "HC": has_hc, + "coolingSAFMethod": coolingSAFMethod, + "heatingSAFMethod": heatingSAFMethod, + "noCoolHeatSAFMethod": noCoolHeatSAFMethod, + }, + **get_info(unitary=u), + ) + ) + + return test_infos + + +def model_default(): + """In this test, this is the Default constructed Unitary System, just adding coils (or not). + + The Supply Air Flow During XXX field is set to Autosize, yet the Method field isn't "SupplyAirFlowRate" but blank. + """ + + m = openstudio.model.Model() + for i in range(3): + openstudio.model.AirLoopHVACUnitarySystem(m) + test_infos = apply_coils_or_not(m, prefix="Default") + return m, test_infos + + +def test_SAF_not_null_but_correct_combos(): + """In this test, the SAF method is filled out, and ALL flow fields are set. + + We respect the SAF method choice, we keep the corresponding flow field, and clear out all the others + """ + m = openstudio.model.Model() + for i in range(3): + u = openstudio.model.AirLoopHVACUnitarySystem(m) + + # Supply Air Flow Rate Method During Cooling Operation + assert u.setSupplyAirFlowRateMethodDuringCoolingOperation("FlowPerFloorArea") + assert u.setSupplyAirFlowRateDuringCoolingOperation(1.0) + assert u.setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(1.1) + assert u.setFractionofAutosizedDesignCoolingSupplyAirFlowRate(1.2) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(1.3) + + # Supply Air Flow Rate Method During Heating Operation + assert u.setSupplyAirFlowRateMethodDuringHeatingOperation("FlowPerHeatingCapacity") + assert u.setSupplyAirFlowRateDuringHeatingOperation(2.0) + assert u.setSupplyAirFlowRatePerFloorAreaduringHeatingOperation(2.1) + assert u.setFractionofAutosizedDesignHeatingSupplyAirFlowRate(2.2) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(2.3) + + # Supply Air Flow Rate Method When No Cooling or Heating is Required + assert u.setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedHeatingValue") + assert u.setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.1) + assert u.setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(0.2) + assert u.setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.3) + assert u.setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.4) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(0.5) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(0.6) + + test_infos = apply_coils_or_not(m, prefix="SAF_correct") + return m, test_infos + + +def test_SAF_not_null_and_incorrect_combos(): + """In this test, the SAF method is filled out, but the corresponding flow field isn't. + + We respect the SAF method choice, and we set the corresponding flow field field to zero + """ + m = openstudio.model.Model() + for i in range(3): + u = openstudio.model.AirLoopHVACUnitarySystem(m) + assert u.setSupplyAirFlowRateMethodDuringCoolingOperation("FractionOfAutosizedCoolingValue") + assert u.setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(1.0) + + assert u.setSupplyAirFlowRateMethodDuringHeatingOperation("FlowPerFloorArea") + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(3.0) + + assert u.setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerCoolingCapacity") + assert u.setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.4) + test_infos = apply_coils_or_not(m, prefix="SAF_incorrect") + return m, test_infos + + +if __name__ == "__main__": + m1, test_infos = model_default() + m1.save("test_vt_UnitarySystem_SAFMethods_default.osm", True) + + m2, test_infos2 = test_SAF_not_null_but_correct_combos() + m2.save("test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm", True) + test_infos += test_infos2 + + m3, test_infos3 = test_SAF_not_null_and_incorrect_combos() + m3.save("test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm", True) + test_infos += test_infos3 + print(test_infos) diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm new file mode 100644 index 00000000000..78c73954cb4 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm @@ -0,0 +1,320 @@ + +OS:Version, + {826bc855-f2b0-4d21-a4e0-7feb01bf135a}, !- Handle + 3.6.1; !- Version Identifier + +OS:AirLoopHVAC:UnitarySystem, + {58e19f48-4089-4b57-9e5e-18ea9c483ad2}, !- Handle + SAF_correct - add_heating_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + {a3fd1a80-687a-4e6c-8552-0a37f52978de}, !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FlowPerFloorArea, !- Supply Air Flow Rate Method During Cooling Operation + 1, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1.1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + 1.2, !- Fraction of Autosized Design Cooling Supply Air Flow Rate + 1.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerHeatingCapacity, !- Supply Air Flow Rate Method During Heating Operation + 2, !- Supply Air Flow Rate During Heating Operation {m3/s} + 2.1, !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + 2.2, !- Fraction of Autosized Design Heating Supply Air Flow Rate + 2.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FractionOfAutosizedHeatingValue, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + 0.1, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + 0.2, !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + 0.3, !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + 0.5, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + 0.6, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {18f22c23-ad26-44ba-bc05-c08bcd95c845}, !- Handle + SAF_correct - add_cooling_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + {cb92d862-d9a0-4e5f-85e6-18684de45d25}, !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FlowPerFloorArea, !- Supply Air Flow Rate Method During Cooling Operation + 1, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1.1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + 1.2, !- Fraction of Autosized Design Cooling Supply Air Flow Rate + 1.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerHeatingCapacity, !- Supply Air Flow Rate Method During Heating Operation + 2, !- Supply Air Flow Rate During Heating Operation {m3/s} + 2.1, !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + 2.2, !- Fraction of Autosized Design Heating Supply Air Flow Rate + 2.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FractionOfAutosizedHeatingValue, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + 0.1, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + 0.2, !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + 0.3, !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + 0.5, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + 0.6, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {891b942e-5509-4dc2-b924-1576b2326fc4}, !- Handle + SAF_correct - None, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FlowPerFloorArea, !- Supply Air Flow Rate Method During Cooling Operation + 1, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1.1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + 1.2, !- Fraction of Autosized Design Cooling Supply Air Flow Rate + 1.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerHeatingCapacity, !- Supply Air Flow Rate Method During Heating Operation + 2, !- Supply Air Flow Rate During Heating Operation {m3/s} + 2.1, !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + 2.2, !- Fraction of Autosized Design Heating Supply Air Flow Rate + 2.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FractionOfAutosizedHeatingValue, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + 0.1, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + 0.2, !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + 0.3, !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + 0.5, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + 0.6, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:Coil:Cooling:DX:SingleSpeed, + {cb92d862-d9a0-4e5f-85e6-18684de45d25}, !- Handle + Coil Cooling DX Single Speed 1, !- Name + {3d5fe8ea-ba4b-40b5-a714-5b9ccef5eef0}, !- Availability Schedule Name + autosize, !- Rated Total Cooling Capacity {W} + autosize, !- Rated Sensible Heat Ratio + 3, !- Rated COP {W/W} + autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Evaporator Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Evaporator Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {3e685313-d3b8-4f51-81ec-faa748cb0ccf}, !- Total Cooling Capacity Function of Temperature Curve Name + {9442da5a-0cd8-4014-ae12-784c9021760c}, !- Total Cooling Capacity Function of Flow Fraction Curve Name + {d14f84e0-acc8-4d8c-acff-529a16de7ce1}, !- Energy Input Ratio Function of Temperature Curve Name + {8e6cd4dd-3705-4541-8afe-9bfe326baf9f}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {a4ec44c3-6139-4982-a95c-a8a3807b2205}, !- Part Load Fraction Correlation Curve Name + -25, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + 0, !- Nominal Time for Condensate Removal to Begin {s} + 0, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless} + 0, !- Maximum Cycling Rate {cycles/hr} + 0, !- Latent Capacity Time Constant {s} + , !- Condenser Air Inlet Node Name + AirCooled, !- Condenser Type + 0.9, !- Evaporative Condenser Effectiveness {dimensionless} + autosize, !- Evaporative Condenser Air Flow Rate {m3/s} + autosize, !- Evaporative Condenser Pump Rated Power Consumption {W} + 0, !- Crankcase Heater Capacity {W} + 10, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + , !- Supply Water Storage Tank Name + , !- Condensate Collection Water Storage Tank Name + 0, !- Basin Heater Capacity {W/K} + 2; !- Basin Heater Setpoint Temperature {C} + +OS:Curve:Biquadratic, + {3e685313-d3b8-4f51-81ec-faa748cb0ccf}, !- Handle + Curve Biquadratic 1, !- Name + 0.942587793, !- Coefficient1 Constant + 0.009543347, !- Coefficient2 x + 0.00068377, !- Coefficient3 x**2 + -0.011042676, !- Coefficient4 y + 5.249e-06, !- Coefficient5 y**2 + -9.72e-06, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {9442da5a-0cd8-4014-ae12-784c9021760c}, !- Handle + Curve Quadratic 1, !- Name + 0.8, !- Coefficient1 Constant + 0.2, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Biquadratic, + {d14f84e0-acc8-4d8c-acff-529a16de7ce1}, !- Handle + Curve Biquadratic 2, !- Name + 0.342414409, !- Coefficient1 Constant + 0.034885008, !- Coefficient2 x + -0.0006237, !- Coefficient3 x**2 + 0.004977216, !- Coefficient4 y + 0.000437951, !- Coefficient5 y**2 + -0.000728028, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {8e6cd4dd-3705-4541-8afe-9bfe326baf9f}, !- Handle + Curve Quadratic 2, !- Name + 1.1552, !- Coefficient1 Constant + -0.1808, !- Coefficient2 x + 0.0256, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Quadratic, + {a4ec44c3-6139-4982-a95c-a8a3807b2205}, !- Handle + Curve Quadratic 3, !- Name + 0.85, !- Coefficient1 Constant + 0.15, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Schedule:Constant, + {3d5fe8ea-ba4b-40b5-a714-5b9ccef5eef0}, !- Handle + Always On Discrete, !- Name + {6848911b-d942-4905-a3d7-a0994b4241f0}, !- Schedule Type Limits Name + 1; !- Value + +OS:ScheduleTypeLimits, + {6848911b-d942-4905-a3d7-a0994b4241f0}, !- Handle + OnOff, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + Discrete, !- Numeric Type + Availability; !- Unit Type + +OS:Coil:Heating:DX:SingleSpeed, + {a3fd1a80-687a-4e6c-8552-0a37f52978de}, !- Handle + Coil Heating DX Single Speed 1, !- Name + {3d5fe8ea-ba4b-40b5-a714-5b9ccef5eef0}, !- Availability Schedule Name + Autosize, !- Rated Total Heating Capacity {W} + 5, !- Rated COP {W/W} + Autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Supply Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Supply Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {4929c2de-327f-4aef-9148-88958a4ea035}, !- Total Heating Capacity Function of Temperature Curve Name + {c16602e7-747a-45d2-b5e3-61006c406dac}, !- Total Heating Capacity Function of Flow Fraction Curve Name + {60d95f6b-2975-4bc2-a419-c058bd09a09b}, !- Energy Input Ratio Function of Temperature Curve Name + {c84710ff-52d9-4e54-a8d8-9548057e0b9e}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {5f186b70-8f3e-4d94-b6c4-714b123581f0}, !- Part Load Fraction Correlation Curve Name + , !- Defrost Energy Input Ratio Function of Temperature Curve Name + , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + , !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C} + , !- Crankcase Heater Capacity {W} + , !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + Resistive, !- Defrost Strategy + Timed, !- Defrost Control + 0.166667, !- Defrost Time Period Fraction + 2000; !- Resistive Defrost Heater Capacity {W} + +OS:Curve:Cubic, + {4929c2de-327f-4aef-9148-88958a4ea035}, !- Handle + Curve Cubic 1, !- Name + 0.758746, !- Coefficient1 Constant + 0.027626, !- Coefficient2 x + 0.000148716, !- Coefficient3 x**2 + 3.4992e-06, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Cubic, + {c16602e7-747a-45d2-b5e3-61006c406dac}, !- Handle + Curve Cubic 2, !- Name + 0.84, !- Coefficient1 Constant + 0.16, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Coefficient4 x**3 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Cubic, + {60d95f6b-2975-4bc2-a419-c058bd09a09b}, !- Handle + Curve Cubic 3, !- Name + 1.19248, !- Coefficient1 Constant + -0.0300438, !- Coefficient2 x + 0.00103745, !- Coefficient3 x**2 + -2.3328e-05, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Quadratic, + {c84710ff-52d9-4e54-a8d8-9548057e0b9e}, !- Handle + Curve Quadratic 4, !- Name + 1.3824, !- Coefficient1 Constant + -0.4336, !- Coefficient2 x + 0.0512, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Curve:Quadratic, + {5f186b70-8f3e-4d94-b6c4-714b123581f0}, !- Handle + Curve Quadratic 5, !- Name + 0.75, !- Coefficient1 Constant + 0.25, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm new file mode 100644 index 00000000000..27dce70c039 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm @@ -0,0 +1,320 @@ + +OS:Version, + {f480fe7b-4869-4f4c-a40f-a36ca5fe0ee2}, !- Handle + 3.6.1; !- Version Identifier + +OS:AirLoopHVAC:UnitarySystem, + {afe538ed-29a5-4bb6-bc93-33362e70a083}, !- Handle + SAF_incorrect - add_heating_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + {c25703b5-59b9-472e-957e-c5e14975ec12}, !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FractionOfAutosizedCoolingValue, !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerFloorArea, !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + 3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FlowPerCoolingCapacity, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {89776c9d-4cc0-43db-b97e-2dcd9395a38d}, !- Handle + SAF_incorrect - add_cooling_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + {7f0c5ec2-2082-4707-b28b-3afdef680ec7}, !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FractionOfAutosizedCoolingValue, !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerFloorArea, !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + 3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FlowPerCoolingCapacity, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {fd298370-9752-4469-868b-df4e69ca764d}, !- Handle + SAF_incorrect - None, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FractionOfAutosizedCoolingValue, !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerFloorArea, !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + 3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FlowPerCoolingCapacity, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:Coil:Cooling:DX:SingleSpeed, + {7f0c5ec2-2082-4707-b28b-3afdef680ec7}, !- Handle + Coil Cooling DX Single Speed 1, !- Name + {d4d7ab0f-8358-4a08-a897-12fcfc3fb6cc}, !- Availability Schedule Name + autosize, !- Rated Total Cooling Capacity {W} + autosize, !- Rated Sensible Heat Ratio + 3, !- Rated COP {W/W} + autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Evaporator Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Evaporator Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {d9bb06f0-03a7-423d-a0c9-abc11ac7e876}, !- Total Cooling Capacity Function of Temperature Curve Name + {be1b33e8-727c-49d3-8daa-8b4a79d6bc94}, !- Total Cooling Capacity Function of Flow Fraction Curve Name + {3ee6c8ce-6f40-4c36-8413-03d331783b42}, !- Energy Input Ratio Function of Temperature Curve Name + {29b0e682-aa96-475d-a269-2a6ac9934604}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {c846593d-7f90-48e2-a049-515c0f2f2f8f}, !- Part Load Fraction Correlation Curve Name + -25, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + 0, !- Nominal Time for Condensate Removal to Begin {s} + 0, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless} + 0, !- Maximum Cycling Rate {cycles/hr} + 0, !- Latent Capacity Time Constant {s} + , !- Condenser Air Inlet Node Name + AirCooled, !- Condenser Type + 0.9, !- Evaporative Condenser Effectiveness {dimensionless} + autosize, !- Evaporative Condenser Air Flow Rate {m3/s} + autosize, !- Evaporative Condenser Pump Rated Power Consumption {W} + 0, !- Crankcase Heater Capacity {W} + 10, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + , !- Supply Water Storage Tank Name + , !- Condensate Collection Water Storage Tank Name + 0, !- Basin Heater Capacity {W/K} + 2; !- Basin Heater Setpoint Temperature {C} + +OS:Curve:Biquadratic, + {d9bb06f0-03a7-423d-a0c9-abc11ac7e876}, !- Handle + Curve Biquadratic 1, !- Name + 0.942587793, !- Coefficient1 Constant + 0.009543347, !- Coefficient2 x + 0.00068377, !- Coefficient3 x**2 + -0.011042676, !- Coefficient4 y + 5.249e-06, !- Coefficient5 y**2 + -9.72e-06, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {be1b33e8-727c-49d3-8daa-8b4a79d6bc94}, !- Handle + Curve Quadratic 1, !- Name + 0.8, !- Coefficient1 Constant + 0.2, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Biquadratic, + {3ee6c8ce-6f40-4c36-8413-03d331783b42}, !- Handle + Curve Biquadratic 2, !- Name + 0.342414409, !- Coefficient1 Constant + 0.034885008, !- Coefficient2 x + -0.0006237, !- Coefficient3 x**2 + 0.004977216, !- Coefficient4 y + 0.000437951, !- Coefficient5 y**2 + -0.000728028, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {29b0e682-aa96-475d-a269-2a6ac9934604}, !- Handle + Curve Quadratic 2, !- Name + 1.1552, !- Coefficient1 Constant + -0.1808, !- Coefficient2 x + 0.0256, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Quadratic, + {c846593d-7f90-48e2-a049-515c0f2f2f8f}, !- Handle + Curve Quadratic 3, !- Name + 0.85, !- Coefficient1 Constant + 0.15, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Schedule:Constant, + {d4d7ab0f-8358-4a08-a897-12fcfc3fb6cc}, !- Handle + Always On Discrete, !- Name + {1cf9fda4-9d4f-4c4c-97c8-1dfef16a2192}, !- Schedule Type Limits Name + 1; !- Value + +OS:ScheduleTypeLimits, + {1cf9fda4-9d4f-4c4c-97c8-1dfef16a2192}, !- Handle + OnOff, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + Discrete, !- Numeric Type + Availability; !- Unit Type + +OS:Coil:Heating:DX:SingleSpeed, + {c25703b5-59b9-472e-957e-c5e14975ec12}, !- Handle + Coil Heating DX Single Speed 1, !- Name + {d4d7ab0f-8358-4a08-a897-12fcfc3fb6cc}, !- Availability Schedule Name + Autosize, !- Rated Total Heating Capacity {W} + 5, !- Rated COP {W/W} + Autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Supply Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Supply Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {794e6866-0c6f-49b9-b8d8-7d2d21937227}, !- Total Heating Capacity Function of Temperature Curve Name + {d4dde2dc-0a92-48b5-9eb4-26e608493c7f}, !- Total Heating Capacity Function of Flow Fraction Curve Name + {52593531-43ad-4c0b-a851-42015604ab16}, !- Energy Input Ratio Function of Temperature Curve Name + {f91e3329-e69a-4d66-909c-88617b95f34e}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {ccf71900-0aa5-4c50-a615-bbd07a61a263}, !- Part Load Fraction Correlation Curve Name + , !- Defrost Energy Input Ratio Function of Temperature Curve Name + , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + , !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C} + , !- Crankcase Heater Capacity {W} + , !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + Resistive, !- Defrost Strategy + Timed, !- Defrost Control + 0.166667, !- Defrost Time Period Fraction + 2000; !- Resistive Defrost Heater Capacity {W} + +OS:Curve:Cubic, + {794e6866-0c6f-49b9-b8d8-7d2d21937227}, !- Handle + Curve Cubic 1, !- Name + 0.758746, !- Coefficient1 Constant + 0.027626, !- Coefficient2 x + 0.000148716, !- Coefficient3 x**2 + 3.4992e-06, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Cubic, + {d4dde2dc-0a92-48b5-9eb4-26e608493c7f}, !- Handle + Curve Cubic 2, !- Name + 0.84, !- Coefficient1 Constant + 0.16, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Coefficient4 x**3 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Cubic, + {52593531-43ad-4c0b-a851-42015604ab16}, !- Handle + Curve Cubic 3, !- Name + 1.19248, !- Coefficient1 Constant + -0.0300438, !- Coefficient2 x + 0.00103745, !- Coefficient3 x**2 + -2.3328e-05, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Quadratic, + {f91e3329-e69a-4d66-909c-88617b95f34e}, !- Handle + Curve Quadratic 4, !- Name + 1.3824, !- Coefficient1 Constant + -0.4336, !- Coefficient2 x + 0.0512, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Curve:Quadratic, + {ccf71900-0aa5-4c50-a615-bbd07a61a263}, !- Handle + Curve Quadratic 5, !- Name + 0.75, !- Coefficient1 Constant + 0.25, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm new file mode 100644 index 00000000000..aad97c86fa8 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm @@ -0,0 +1,320 @@ + +OS:Version, + {6f99e915-0dea-4dbe-96bd-3b7234a03c18}, !- Handle + 3.6.1; !- Version Identifier + +OS:AirLoopHVAC:UnitarySystem, + {f3f3c3bf-3329-40f8-9123-5215c701ef2b}, !- Handle + Default - add_heating_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + {d6a209af-209d-471c-a4ea-71ab99d79d3f}, !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + , !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + , !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + , !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + , !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {be0b4235-62b4-4df8-a51b-e1d49176e17d}, !- Handle + Default - add_cooling_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + {bb05defc-c2ad-4aad-b7fb-93b0fa1b50ce}, !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + , !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + , !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + , !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + , !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {72536bc6-9c33-45c4-9648-14117e0d545a}, !- Handle + Default - None, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + , !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + , !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + , !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + , !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:Coil:Cooling:DX:SingleSpeed, + {bb05defc-c2ad-4aad-b7fb-93b0fa1b50ce}, !- Handle + Coil Cooling DX Single Speed 1, !- Name + {d9b16da6-9221-4d9e-8d71-0f29546866be}, !- Availability Schedule Name + autosize, !- Rated Total Cooling Capacity {W} + autosize, !- Rated Sensible Heat Ratio + 3, !- Rated COP {W/W} + autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Evaporator Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Evaporator Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {de8d266b-78ba-4848-a454-b96278b6c40d}, !- Total Cooling Capacity Function of Temperature Curve Name + {057a4af8-88a6-42e9-86e1-0f819a786b0b}, !- Total Cooling Capacity Function of Flow Fraction Curve Name + {0f22f79d-d2ce-4c53-a45c-3cbcca8fe6e4}, !- Energy Input Ratio Function of Temperature Curve Name + {1cb80fcb-2950-4157-9d46-4ea1fc8e7f2b}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {43556f19-7e35-4287-90a7-2bf9054f0a46}, !- Part Load Fraction Correlation Curve Name + -25, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + 0, !- Nominal Time for Condensate Removal to Begin {s} + 0, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless} + 0, !- Maximum Cycling Rate {cycles/hr} + 0, !- Latent Capacity Time Constant {s} + , !- Condenser Air Inlet Node Name + AirCooled, !- Condenser Type + 0.9, !- Evaporative Condenser Effectiveness {dimensionless} + autosize, !- Evaporative Condenser Air Flow Rate {m3/s} + autosize, !- Evaporative Condenser Pump Rated Power Consumption {W} + 0, !- Crankcase Heater Capacity {W} + 10, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + , !- Supply Water Storage Tank Name + , !- Condensate Collection Water Storage Tank Name + 0, !- Basin Heater Capacity {W/K} + 2; !- Basin Heater Setpoint Temperature {C} + +OS:Curve:Biquadratic, + {de8d266b-78ba-4848-a454-b96278b6c40d}, !- Handle + Curve Biquadratic 1, !- Name + 0.942587793, !- Coefficient1 Constant + 0.009543347, !- Coefficient2 x + 0.00068377, !- Coefficient3 x**2 + -0.011042676, !- Coefficient4 y + 5.249e-06, !- Coefficient5 y**2 + -9.72e-06, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {057a4af8-88a6-42e9-86e1-0f819a786b0b}, !- Handle + Curve Quadratic 1, !- Name + 0.8, !- Coefficient1 Constant + 0.2, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Biquadratic, + {0f22f79d-d2ce-4c53-a45c-3cbcca8fe6e4}, !- Handle + Curve Biquadratic 2, !- Name + 0.342414409, !- Coefficient1 Constant + 0.034885008, !- Coefficient2 x + -0.0006237, !- Coefficient3 x**2 + 0.004977216, !- Coefficient4 y + 0.000437951, !- Coefficient5 y**2 + -0.000728028, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {1cb80fcb-2950-4157-9d46-4ea1fc8e7f2b}, !- Handle + Curve Quadratic 2, !- Name + 1.1552, !- Coefficient1 Constant + -0.1808, !- Coefficient2 x + 0.0256, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Quadratic, + {43556f19-7e35-4287-90a7-2bf9054f0a46}, !- Handle + Curve Quadratic 3, !- Name + 0.85, !- Coefficient1 Constant + 0.15, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Schedule:Constant, + {d9b16da6-9221-4d9e-8d71-0f29546866be}, !- Handle + Always On Discrete, !- Name + {f5380b2f-2236-4498-afe8-a744f74e129b}, !- Schedule Type Limits Name + 1; !- Value + +OS:ScheduleTypeLimits, + {f5380b2f-2236-4498-afe8-a744f74e129b}, !- Handle + OnOff, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + Discrete, !- Numeric Type + Availability; !- Unit Type + +OS:Coil:Heating:DX:SingleSpeed, + {d6a209af-209d-471c-a4ea-71ab99d79d3f}, !- Handle + Coil Heating DX Single Speed 1, !- Name + {d9b16da6-9221-4d9e-8d71-0f29546866be}, !- Availability Schedule Name + Autosize, !- Rated Total Heating Capacity {W} + 5, !- Rated COP {W/W} + Autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Supply Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Supply Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {8ab033a4-9daf-49b6-aa94-c35f67f0104d}, !- Total Heating Capacity Function of Temperature Curve Name + {5ba05bcf-e2e8-4a39-9c2b-549daed55da8}, !- Total Heating Capacity Function of Flow Fraction Curve Name + {6e54493e-45e7-41db-a31e-7a10dc13a23e}, !- Energy Input Ratio Function of Temperature Curve Name + {188e8017-d722-4d68-be85-dcc41e11b0ef}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {9870c076-04bc-4c08-aec7-6bd71f17a9cf}, !- Part Load Fraction Correlation Curve Name + , !- Defrost Energy Input Ratio Function of Temperature Curve Name + , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + , !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C} + , !- Crankcase Heater Capacity {W} + , !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + Resistive, !- Defrost Strategy + Timed, !- Defrost Control + 0.166667, !- Defrost Time Period Fraction + 2000; !- Resistive Defrost Heater Capacity {W} + +OS:Curve:Cubic, + {8ab033a4-9daf-49b6-aa94-c35f67f0104d}, !- Handle + Curve Cubic 1, !- Name + 0.758746, !- Coefficient1 Constant + 0.027626, !- Coefficient2 x + 0.000148716, !- Coefficient3 x**2 + 3.4992e-06, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Cubic, + {5ba05bcf-e2e8-4a39-9c2b-549daed55da8}, !- Handle + Curve Cubic 2, !- Name + 0.84, !- Coefficient1 Constant + 0.16, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Coefficient4 x**3 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Cubic, + {6e54493e-45e7-41db-a31e-7a10dc13a23e}, !- Handle + Curve Cubic 3, !- Name + 1.19248, !- Coefficient1 Constant + -0.0300438, !- Coefficient2 x + 0.00103745, !- Coefficient3 x**2 + -2.3328e-05, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Quadratic, + {188e8017-d722-4d68-be85-dcc41e11b0ef}, !- Handle + Curve Quadratic 4, !- Name + 1.3824, !- Coefficient1 Constant + -0.4336, !- Coefficient2 x + 0.0512, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Curve:Quadratic, + {9870c076-04bc-4c08-aec7-6bd71f17a9cf}, !- Handle + Curve Quadratic 5, !- Name + 0.75, !- Coefficient1 Constant + 0.25, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index dfacbb21b60..77a82c73ac4 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "../../utilities/core/Compare.hpp" @@ -2548,3 +2549,200 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_GroundHeatExchangerVertical) { EXPECT_EQ(3.2, uka.getDouble(6).get()); // Average Amplitude of Surface Temperature EXPECT_EQ(8.0, uka.getDouble(7).get()); // Phase Shift of Minimum Surface Temperature } + +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_default) { + openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm"); + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + // ===================================================================================================== + // In this test, this is the Default constructed Unitary System, just adding coils (or not). + // The Supply Air Flow During XXX field is set to Autosize, + // yet the Method field isn't "SupplyAirFlowRate" but blank. + // ===================================================================================================== + + std::vector unitarys = model_->getObjectsByType("OS:AirLoopHVAC:UnitarySystem"); + ASSERT_EQ(3u, unitarys.size()); + for (const auto& unitary : unitarys) { + + const bool hasHeatingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::HeatingCoilName); + const bool hasCoolingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName); + + if (hasCoolingCoil) { + EXPECT_EQ("SupplyAirFlowRate", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_EQ("Autosize", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation)); + + if (hasHeatingCoil) { + EXPECT_EQ("SupplyAirFlowRate", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_EQ("Autosize", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation)); + + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired)); + } +} + +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_CorrectCombos) { + openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm"); + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + // ===================================================================================================== + // In this test, the SAF method is filled out, and ALL flow fields are set. + // We respect the SAF method choice, we keep the corresponding flow field, and clear out all the others + // ===================================================================================================== + + std::vector unitarys = model_->getObjectsByType("OS:AirLoopHVAC:UnitarySystem"); + ASSERT_EQ(3u, unitarys.size()); + for (const auto& unitary : unitarys) { + + const bool hasHeatingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::HeatingCoilName); + const bool hasCoolingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName); + + if (hasCoolingCoil) { + EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_EQ(1.1, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation)); + + if (hasHeatingCoil) { + EXPECT_EQ("FlowPerHeatingCapacity", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_EQ(2.3, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRate)); + + if (hasCoolingCoil || hasHeatingCoil) { + EXPECT_EQ("FractionOfAutosizedHeatingValue", + unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_EQ( + 0.4, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) + .get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired)); + } +} + +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_IncorrectCombos) { + openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm"); + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + std::vector unitarys = model_->getObjectsByType("OS:AirLoopHVAC:UnitarySystem"); + ASSERT_EQ(3u, unitarys.size()); + + // ===================================================================================================== + // In this test, the SAF method is filled out, but the corresponding flow field isn't. + // We respect the SAF method choice, and we set the corresponding flow field field to zero + // ===================================================================================================== + + constexpr double ZERO = 0.0; + + for (const auto& unitary : unitarys) { + + const bool hasHeatingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::HeatingCoilName); + const bool hasCoolingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName); + + if (hasCoolingCoil) { + EXPECT_EQ("FractionOfAutosizedCoolingValue", + unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_EQ(ZERO, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation)); + + if (hasHeatingCoil) { + EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_EQ(ZERO, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation)); + + if (hasCoolingCoil || hasHeatingCoil) { + EXPECT_EQ("FlowPerCoolingCapacity", + unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_EQ( + ZERO, unitary + .getDouble( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) + .get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired)); + } +} From 8309dd9166df7008ec042c9b87032d034ec13ec8 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 22 Sep 2023 15:20:06 +0200 Subject: [PATCH 26/32] Fix VT for tests to pass --- src/osversion/VersionTranslator.cpp | 99 ++++++++++++++++++----------- 1 file changed, 61 insertions(+), 38 deletions(-) diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index 1f10f3dd1b5..24cf3aa8de9 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -7755,26 +7755,35 @@ namespace osversion { } } if (!found) { - LOG(Warn, "For " << object.briefDescription() - << ", there is a cooling coil, but no Supply Air Flow Rate Method During Cooling Operation and no flow rate fields set. " - "Defaulting to SupplyAirFlowRate with Autosize"); + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', there is a cooling coil, but no Supply Air Flow Rate Method During Cooling Operation and no flow rate fields set. " + "Defaulting to SupplyAirFlowRate with Autosize"); newObject.setString(coolingSAFMethodIndex, "SupplyAirFlowRate"); newObject.setString(coolingSAFMethodIndex + 1, "Autosize"); } } else { std::string coolingSAFMethodUC = ascii_to_upper_copy(*coolingSAFMethod); - auto it = std::find_if(coolingSAFMethodChoicesUC.cbegin(), coolingSAFMethodChoicesUC.cend(), - [&coolingSAFMethodUC](auto& s) { return s == coolingSAFMethodUC; }); - if (it == coolingSAFMethodChoicesUC.cend()) { - LOG(Error, - "For " << object.briefDescription() << ", Unrecognized Supply Air Flow Method Rate During Cooling Operation=" << *coolingSAFMethod); + if (coolingSAFMethodUC == "NONE") { + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', Supply Air Flow Method Rate During Cooling Operation is 'None' but you have a Cooling Coil, consider changing it"); } else { - auto index = std::distance(coolingSAFMethodChoicesUC.cbegin(), it); - if ((value == object.getString(index))) { - newObject.setString(index, *value); + auto it = std::find_if(coolingSAFMethodChoicesUC.cbegin(), coolingSAFMethodChoicesUC.cend(), + [&coolingSAFMethodUC](auto& s) { return s == coolingSAFMethodUC; }); + if (it == coolingSAFMethodChoicesUC.cend()) { + LOG(Error, "For AirLoopHVACUnitarySystem '" + << object.nameString() << "', Unrecognized Supply Air Flow Method Rate During Cooling Operation=" << *coolingSAFMethod); } else { - LOG(Error, "For " << object.briefDescription() << ", Supply Air Flow Method Rate During Cooling Operation is '" << *coolingSAFMethod - << "' but associated field is empty"); + const auto dist = std::distance(coolingSAFMethodChoicesUC.cbegin(), it); + const size_t index = coolingSAFMethodIndex + 1 + dist; + if ((value = object.getString(index))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() << "', Supply Air Flow Method Rate During Cooling Operation is '" + << *coolingSAFMethod << "' but associated field is empty. Setting it to zero."); + newObject.setDouble(index, 0.0); + } } } } @@ -7799,26 +7808,35 @@ namespace osversion { } } if (!found) { - LOG(Warn, "For " << object.briefDescription() - << ", there is a heating coil, but no Supply Air Flow Rate Method During Heating Operation and no flow rate fields set. " - "Defaulting to SupplyAirFlowRate with Autosize"); + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', there is a heating coil, but no Supply Air Flow Rate Method During Heating Operation and no flow rate fields set. " + "Defaulting to SupplyAirFlowRate with Autosize"); newObject.setString(heatingSAFMethodIndex, "SupplyAirFlowRate"); newObject.setString(heatingSAFMethodIndex + 1, "Autosize"); } } else { std::string heatingSAFMethodUC = ascii_to_upper_copy(*heatingSAFMethod); - auto it = std::find_if(heatingSAFMethodChoicesUC.cbegin(), heatingSAFMethodChoicesUC.cend(), - [&heatingSAFMethodUC](auto& s) { return s == heatingSAFMethodUC; }); - if (it == heatingSAFMethodChoicesUC.cend()) { - LOG(Error, - "For " << object.briefDescription() << ", Unrecognized Supply Air Flow Method Rate During Heating Operation=" << *heatingSAFMethod); + if (heatingSAFMethodUC == "NONE") { + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', Supply Air Flow Method Rate During Heating Operation is 'None' but you have a Heating coil, consider changing it"); } else { - auto index = std::distance(heatingSAFMethodChoicesUC.cbegin(), it); - if ((value == object.getString(index))) { - newObject.setString(index, *value); + auto it = std::find_if(heatingSAFMethodChoicesUC.cbegin(), heatingSAFMethodChoicesUC.cend(), + [&heatingSAFMethodUC](auto& s) { return s == heatingSAFMethodUC; }); + if (it == heatingSAFMethodChoicesUC.cend()) { + LOG(Error, "For AirLoopHVACUnitarySystem '" + << object.nameString() << "', Unrecognized Supply Air Flow Method Rate During Heating Operation=" << *heatingSAFMethod); } else { - LOG(Error, "For " << object.briefDescription() << ", Supply Air Flow Method Rate During Heating Operation is '" << *heatingSAFMethod - << "' but associated field is empty"); + auto dist = std::distance(heatingSAFMethodChoicesUC.cbegin(), it); + const size_t index = heatingSAFMethodIndex + 1 + dist; + if ((value = object.getString(index))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() << "', Supply Air Flow Method Rate During Heating Operation is '" + << *heatingSAFMethod << "' but associated field is empty. Setting it to zero."); + newObject.setDouble(index, 0.0); + } } } } @@ -7848,7 +7866,7 @@ namespace osversion { } } if (!found) { - LOG(Warn, "For " << object.briefDescription() + LOG(Warn, "For AirLoopHVACUnitarySystem '" << object.nameString() << ", there is no Supply Air Flow Rate Method When No Cooling or Heating is Required and no flow rate fields set. " "Defaulting to None"); newObject.setString(noCoolHeatSAFMethodIndex, "None"); @@ -7856,18 +7874,23 @@ namespace osversion { #endif } else { std::string noCoolHeatSAFMethodUC = ascii_to_upper_copy(*noCoolHeatSAFMethod); - auto it = std::find_if(noCoolHeatSAFMethodChoicesUC.cbegin(), noCoolHeatSAFMethodChoicesUC.cend(), - [&noCoolHeatSAFMethodUC](auto& s) { return s == noCoolHeatSAFMethodUC; }); - if (it == noCoolHeatSAFMethodChoicesUC.cend()) { - LOG(Error, "For " << object.briefDescription() - << ", Unrecognized Supply Air Flow Rate Method When No Cooling or Heating is Required=" << *noCoolHeatSAFMethod); - } else { - auto index = std::distance(noCoolHeatSAFMethodChoicesUC.cbegin(), it); - if ((value == object.getString(index))) { - newObject.setString(index, *value); + if (noCoolHeatSAFMethodUC != "NONE") { + auto it = std::find_if(noCoolHeatSAFMethodChoicesUC.cbegin(), noCoolHeatSAFMethodChoicesUC.cend(), + [&noCoolHeatSAFMethodUC](auto& s) { return s == noCoolHeatSAFMethodUC; }); + if (it == noCoolHeatSAFMethodChoicesUC.cend()) { + LOG(Error, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', Unrecognized Supply Air Flow Rate Method When No Cooling or Heating is Required=" << *noCoolHeatSAFMethod); } else { - LOG(Error, "For " << object.briefDescription() << ", Supply Air Flow Rate Method When No Cooling or Heating is Required is '" - << *noCoolHeatSAFMethod << "' but associated field is empty"); + auto dist = std::distance(noCoolHeatSAFMethodChoicesUC.cbegin(), it); + const size_t index = noCoolHeatSAFMethodIndex + 1 + dist; + if ((value = object.getString(index))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() + << "', Supply Air Flow Rate Method When No Cooling or Heating is Required is '" + << *noCoolHeatSAFMethod << "' but associated field is empty"); + } } } } From c404add23cc264a9566220bb26319e1387840181 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 22 Sep 2023 15:38:26 +0200 Subject: [PATCH 27/32] Update release notes [ci skip] --- .../doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md | 7 +++++-- .../test/3_7_0/test_vt_UnitarySystem_SAFMethods.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md index 45b7975013c..bc04d9725e5 100644 --- a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md +++ b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md @@ -74,10 +74,13 @@ You can also refer to the [OpenStudio SDK Python Binding Version Compatibility M ## New Features, Major Fixes and API-breaking changes * [#4827](https://github.com/NREL/OpenStudio/pull/4827) - #4748 #4817 - Validate BCLXML with schema when loading + make sorting of files in measure.xml consistent when saving -* [#4873](https://github.com/NREL/OpenStudio/pull/4873) - AirLoopHVACUnitarySystem set Method During XXX Operation +* [#4873](https://github.com/NREL/OpenStudio/pull/4873) & [#4971](https://github.com/NREL/OpenStudio/pull/4971) - AirLoopHVACUnitarySystem set Method During XXX Operation * Fix #4695 - AirLoopHVACUnitarySystem: Supply Air Flow Rate Method During Operation should be set via related setters/autosize - * Breaks the return of `supplyAirFlowRateMethodDuringCoolingOperation` and `supplyAirFlowRateMethodDuringHeatingOperation`: now returns `std::string` instead of `boost::optional` + * Breaks the return of `supplyAirFlowRateMethodDuringCoolingOperation`, `supplyAirFlowRateMethodDuringHeatingOperation` and `supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()`: now returns `std::string` instead of `boost::optional` * Deprecates many set/reset methods + * These fields are now non-optional, and are set via the flow field setters and reset when the heating/cooling coils are reset. + * Example: `unitary.setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(1.0)` will set the "Supply Air Flow Rate Method During Cooling Operation" to "FlowPerFloorArea" + * [#4932](https://github.com/NREL/OpenStudio/pull/4932) - Support undisturbed ground temperature models on GroundHeatExchangerVertical * Fix #4930 - Support undisturbed ground temperature models on GroundHeatExchangerVertical * Update `GroundHeatExchanger:Vertical` to actually use the Ground Temeprature Model field diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py index 43fd7ebb209..3c9aa44887a 100644 --- a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py @@ -1,5 +1,7 @@ import openstudio +assert openstudio.openStudioVersion() == "3.6.1" + FIELD_IDENTIFIERS = [ "CoolingSAFMethod", "CoolingSAFMethod_SAFlow", From 50c9ea94acd383602573cbb8c06b49ec0a5893cf Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 22 Sep 2023 16:05:37 +0200 Subject: [PATCH 28/32] Mac does not like the EXPECT_EQ(ZERO) witht he constexpr ``` ZERO Which is: 0 unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get() Which is: 1.03613e-317 /Users/jenkins/git/OpenStudioIncr ``` --- src/osversion/test/VersionTranslator_GTest.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index 77a82c73ac4..108fb48e139 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -2690,8 +2690,6 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec // We respect the SAF method choice, and we set the corresponding flow field field to zero // ===================================================================================================== - constexpr double ZERO = 0.0; - for (const auto& unitary : unitarys) { const bool hasHeatingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::HeatingCoilName); @@ -2700,7 +2698,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasCoolingCoil) { EXPECT_EQ("FractionOfAutosizedCoolingValue", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); - EXPECT_EQ(ZERO, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()); + EXPECT_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()); } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); @@ -2711,7 +2709,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasHeatingCoil) { EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); - EXPECT_EQ(ZERO, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()); + EXPECT_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()); } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); @@ -2725,10 +2723,10 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec EXPECT_EQ("FlowPerCoolingCapacity", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); EXPECT_EQ( - ZERO, unitary - .getDouble( - OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) - .get()); + 0.0, unitary + .getDouble( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) + .get()); } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); EXPECT_TRUE(unitary.isEmpty( From ce0d9c67f3a208048a8a20106c9d74821ed71c97 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 25 Sep 2023 11:31:07 +0200 Subject: [PATCH 29/32] Use EXPECT_DOUBLE_EQ. Mac still unhappy --- src/osversion/test/VersionTranslator_GTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index 108fb48e139..1c3705336b8 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -2698,7 +2698,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasCoolingCoil) { EXPECT_EQ("FractionOfAutosizedCoolingValue", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); - EXPECT_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()); + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()); } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); @@ -2709,7 +2709,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasHeatingCoil) { EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); - EXPECT_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()); + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()); } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); @@ -2722,7 +2722,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasCoolingCoil || hasHeatingCoil) { EXPECT_EQ("FlowPerCoolingCapacity", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); - EXPECT_EQ( + EXPECT_DOUBLE_EQ( 0.0, unitary .getDouble( OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) From ff0889428460440d6c26a353277d520fc7464fbf Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 26 Sep 2023 17:08:32 +0200 Subject: [PATCH 30/32] Print the unitary system for the failing mac CI tests in EXPECT_DOUBLE_EQ --- src/osversion/test/VersionTranslator_GTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index 1c3705336b8..6b557107c89 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -2698,7 +2698,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasCoolingCoil) { EXPECT_EQ("FractionOfAutosizedCoolingValue", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); - EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()); + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()) << unitary; } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); @@ -2709,7 +2709,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasHeatingCoil) { EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); - EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()); + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()) << unitary; } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); @@ -2726,7 +2726,7 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec 0.0, unitary .getDouble( OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) - .get()); + .get()) << unitary; } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); EXPECT_TRUE(unitary.isEmpty( From 304fdfaaf5cf33de08924b0433b262e778f40d7d Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 27 Sep 2023 11:50:36 +0200 Subject: [PATCH 31/32] Fix #4978 - adjust definitions for boost 1.79 to work with modern clang/apple clang alike Xcode removed auto_ptr before 10.1 (not sure when) Xcode 15: removed unary/binary_function: * https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes * unary_function and binary_function are no longer provided in C++17 and newer Standard modes. They can be re-enabled with _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 836e429b0e7..2675441ea8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,8 +377,9 @@ if(APPLE) # This appears to be a legacy choice by the cmake developers, and seems out of place, # so the OpenStudio project will use the library suffix ".dylib" find_library(COREFOUNDATION_LIBRARY CoreFoundation) - add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) - #add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED) + # TODO: remove when bumping Boost to 1.81+, cf https://github.com/NREL/OpenStudio/issues/4978 + add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE) + add_definitions(-D_HAS_AUTO_PTR_ETC=0) endif() if(UNIX AND NOT APPLE) From 50fe58a1e720854fd0e01a12325be38e0227e5bc Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 27 Sep 2023 16:13:36 +0200 Subject: [PATCH 32/32] Hotfix #4971 - fix VersionTranslator and test --- src/osversion/VersionTranslator.cpp | 13 +++++++------ src/osversion/test/VersionTranslator_GTest.cpp | 16 ++++++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index 24cf3aa8de9..c2d587c795e 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -7747,7 +7747,7 @@ namespace osversion { bool found = false; for (size_t i = 0; i < coolingSAFMethodChoices.size(); ++i) { const size_t fieldIndex = coolingSAFMethodIndex + 1 + i; - if ((value = object.getString(fieldIndex))) { + if ((value = object.getString(fieldIndex, false, true))) { newObject.setString(coolingSAFMethodIndex, std::string{coolingSAFMethodChoices[i]}); newObject.setString(fieldIndex, *value); found = true; @@ -7777,7 +7777,7 @@ namespace osversion { } else { const auto dist = std::distance(coolingSAFMethodChoicesUC.cbegin(), it); const size_t index = coolingSAFMethodIndex + 1 + dist; - if ((value = object.getString(index))) { + if ((value = object.getString(index, false, true))) { newObject.setString(index, *value); } else { LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() << "', Supply Air Flow Method Rate During Cooling Operation is '" @@ -7800,7 +7800,7 @@ namespace osversion { bool found = false; for (size_t i = 0; i < heatingSAFMethodChoices.size(); ++i) { const size_t fieldIndex = heatingSAFMethodIndex + 1 + i; - if ((value = object.getString(fieldIndex))) { + if ((value = object.getString(fieldIndex, false, true))) { newObject.setString(heatingSAFMethodIndex, std::string{heatingSAFMethodChoices[i]}); newObject.setString(fieldIndex, *value); found = true; @@ -7830,7 +7830,7 @@ namespace osversion { } else { auto dist = std::distance(heatingSAFMethodChoicesUC.cbegin(), it); const size_t index = heatingSAFMethodIndex + 1 + dist; - if ((value = object.getString(index))) { + if ((value = object.getString(index, false, true))) { newObject.setString(index, *value); } else { LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() << "', Supply Air Flow Method Rate During Heating Operation is '" @@ -7858,7 +7858,7 @@ namespace osversion { bool found = false; for (size_t i = 0; i < noCoolHeatSAFMethodChoices.size(); ++i) { const size_t fieldIndex = noCoolHeatSAFMethodIndex + 1 + i; - if ((value = object.getString(fieldIndex))) { + if ((value = object.getString(fieldIndex, false, true))) { newObject.setString(noCoolHeatSAFMethodIndex, std::string{noCoolHeatSAFMethodChoices[i]}); newObject.setString(fieldIndex, *value); found = true; @@ -7884,12 +7884,13 @@ namespace osversion { } else { auto dist = std::distance(noCoolHeatSAFMethodChoicesUC.cbegin(), it); const size_t index = noCoolHeatSAFMethodIndex + 1 + dist; - if ((value = object.getString(index))) { + if ((value = object.getString(index, false, true))) { newObject.setString(index, *value); } else { LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() << "', Supply Air Flow Rate Method When No Cooling or Heating is Required is '" << *noCoolHeatSAFMethod << "' but associated field is empty"); + newObject.setDouble(index, 0.0); } } } diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index 6b557107c89..7c2374fdeee 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -2698,24 +2698,27 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec if (hasCoolingCoil) { EXPECT_EQ("FractionOfAutosizedCoolingValue", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); - EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()) << unitary; + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()) + << unitary; } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); } EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation)); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation)); + // EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation)); if (hasHeatingCoil) { EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); - EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()) << unitary; + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()) + << unitary; } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); } EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation)); - EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + // EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRate)); EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation)); @@ -2726,7 +2729,8 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec 0.0, unitary .getDouble( OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) - .get()) << unitary; + .get()) + << unitary; } else { EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); EXPECT_TRUE(unitary.isEmpty( @@ -2738,8 +2742,8 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_Incorrec unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); EXPECT_TRUE( unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); - EXPECT_TRUE(unitary.isEmpty( - OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + // EXPECT_TRUE(unitary.isEmpty( + // OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); EXPECT_TRUE(unitary.isEmpty( OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired)); }