Skip to content

Commit

Permalink
Update model resource files.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Dec 20, 2024
1 parent 861dfdf commit 44f0405
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 78 deletions.
2 changes: 2 additions & 0 deletions src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateZoneHVACEnergyRecoveryVentilator.cpp
ForwardTranslator/ForwardTranslateZoneHVACEnergyRecoveryVentilatorController.cpp
ForwardTranslator/ForwardTranslateZoneHVACEquipmentList.cpp
ForwardTranslator/ForwardTranslateZoneHVACEvaporativeCoolerUnit.cpp
ForwardTranslator/ForwardTranslateZoneHVACFourPipeFanCoil.cpp
ForwardTranslator/ForwardTranslateZoneHVACHighTemperatureRadiant.cpp
ForwardTranslator/ForwardTranslateZoneHVACIdealLoadsAirSystem.cpp
Expand Down Expand Up @@ -839,6 +840,7 @@ set(${target_name}_test_src
Test/WaterUseConnections_GTest.cpp
Test/ZoneAirHeatBalanceAlgorithm_GTest.cpp
Test/ZoneHVACBaseboardRadiantConvectiveWater_GTest.cpp
Test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp
Test/ZoneHVACLowTemperatureRadiantElectric_GTest.cpp
Test/ZoneHVACLowTempRadiantConstFlow_GTest.cpp
Test/ZoneHVACLowTempRadiantVarFlow_GTest.cpp
Expand Down
5 changes: 5 additions & 0 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3204,6 +3204,11 @@ namespace energyplus {
retVal = translateZoneHVACEquipmentList(mo);
break;
}
case openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit: {
auto mo = modelObject.cast<ZoneHVACEvaporativeCoolerUnit>();
retVal = translateZoneHVACEvaporativeCoolerUnit(mo);
break;
}
case openstudio::IddObjectType::OS_ZoneHVAC_FourPipeFanCoil: {
auto mo = modelObject.cast<ZoneHVACFourPipeFanCoil>();
retVal = translateZoneHVACFourPipeFanCoil(mo);
Expand Down
3 changes: 3 additions & 0 deletions src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ namespace model {
class ZoneHVACEnergyRecoveryVentilator;
class ZoneHVACEnergyRecoveryVentilatorController;
class ZoneHVACEquipmentList;
class ZoneHVACEvaporativeCoolerUnit;
class ZoneHVACFourPipeFanCoil;
class ZoneHVACHighTemperatureRadiant;
class ZoneHVACIdealLoadsAirSystem;
Expand Down Expand Up @@ -1551,6 +1552,8 @@ namespace energyplus {

boost::optional<IdfObject> translateZoneHVACEquipmentList(model::ZoneHVACEquipmentList& modelObject);

boost::optional<IdfObject> translateZoneHVACEvaporativeCoolerUnit(model::ZoneHVACEvaporativeCoolerUnit& modelObject);

boost::optional<IdfObject> translateZoneHVACFourPipeFanCoil(model::ZoneHVACFourPipeFanCoil& modelObject);

boost::optional<IdfObject> translateZoneHVACHighTemperatureRadiant(model::ZoneHVACHighTemperatureRadiant& modelObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,51 +60,50 @@ namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateZoneHVACEvaporativeCoolerUnit( model::ZoneHVACEvaporativeCoolerUnit& modelObject ) {
boost::optional<IdfObject> ForwardTranslator::translateZoneHVACEvaporativeCoolerUnit(model::ZoneHVACEvaporativeCoolerUnit& modelObject) {

// Instantiate an IdfObject of the class to store the values
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ZoneHVAC_EvaporativeCoolerUnit, modelObject);

// Availability Schedule Name: Optional Object
if (boost::optional<Schedule> availabilitySchedule_ = modelObject.availabilitySchedule()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(availabilitySchedule_.get())) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(availabilitySchedule_.get())) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityScheduleName, wo_->nameString());
}
}

// Availability Manager List Name: Optional Object
if (boost::optional<SystemAvailabilityManagerLists> availabilityManagerList_ = modelObject.availabilityManagerList()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(availabilityManagerList_.get())) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(availabilityManagerList_.get())) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityManagerListName, wo_->nameString());
}
}

// Outdoor Air Inlet Node Name: Required Node
Node outdoorAirInletNodeName = modelObject.inletNode();
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(outdoorAirInletNodeName)) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(outdoorAirInletNodeName)) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::OutdoorAirInletNodeName, wo_->nameString());
}

// Cooler Outlet Node Name: Required Node
Node coolerOutletNodeName = modelObject.outletNode();
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(coolerOutletNodeName)) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(coolerOutletNodeName)) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerOutletNodeName, wo_->nameString());
}

// Zone Relief Air Node Name: Optional Node
Node zoneReliefAirNodeName = modelObject.zoneReliefAirNodeName();
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(zoneReliefAirNodeName)) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(zoneReliefAirNodeName)) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::ZoneReliefAirNodeName, wo_->nameString());
}

// Supply Air Fan Object Type: Required String
const std::string supplyAirFanObjectType = modelObject.supplyAirFanObjectType();
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanObjectType, supplyAirFanObjectType);


// Supply Air Fan Name: Required Object
Fans supplyAirFan = modelObject.supplyAirFan();
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(supplyAirFan)) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(supplyAirFan)) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanName, wo_->nameString());
}

Expand All @@ -115,36 +114,32 @@ namespace energyplus {
if (boost::optional<double> designSupplyAirFlowRate_ = modelObject.designSupplyAirFlowRate()) {
idfObject.setDouble(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSupplyAirFlowRate, designSupplyAirFlowRate_.get());
}
}
}

// Fan Placement: Required String
const std::string fanPlacement = modelObject.fanPlacement();
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::FanPlacement, fanPlacement);


// Cooler Unit Control Method: Required String
const std::string coolerUnitControlMethod = modelObject.coolerUnitControlMethod();
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerUnitControlMethod, coolerUnitControlMethod);


// Throttling Range Temperature Difference: Optional Double
const double throttlingRangeTemperatureDifference = modelObject.throttlingRangeTemperatureDifference();
idfObject.setDouble(ZoneHVAC_EvaporativeCoolerUnitFields::ThrottlingRangeTemperatureDifference, throttlingRangeTemperatureDifference);


// Cooling Load Control Threshold Heat Transfer Rate: Optional Double
const double coolingLoadControlThresholdHeatTransferRate = modelObject.coolingLoadControlThresholdHeatTransferRate();
idfObject.setDouble(ZoneHVAC_EvaporativeCoolerUnitFields::CoolingLoadControlThresholdHeatTransferRate, coolingLoadControlThresholdHeatTransferRate);

idfObject.setDouble(ZoneHVAC_EvaporativeCoolerUnitFields::CoolingLoadControlThresholdHeatTransferRate,
coolingLoadControlThresholdHeatTransferRate);

// First Evaporative Cooler Object Type: Required String
const std::string firstEvaporativeCoolerObjectType = modelObject.firstEvaporativeCoolerObjectType();
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::FirstEvaporativeCoolerObjectType, firstEvaporativeCoolerObjectType);


// First Evaporative Cooler Object Name: Required Object
EvapCooler firstEvaporativeCoolerObject = modelObject.firstEvaporativeCoolerObject();
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(firstEvaporativeCoolerObject)) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(firstEvaporativeCoolerObject)) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::FirstEvaporativeCoolerObjectName, wo_->nameString());
}

Expand All @@ -155,14 +150,15 @@ namespace energyplus {

// Second Evaporative Cooler Name: Optional Object
if (boost::optional<EvapCooler> secondEvaporativeCooler_ = modelObject.secondEvaporativeCooler()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(secondEvaporativeCooler_.get())) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(secondEvaporativeCooler_.get())) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerName, wo_->nameString());
}
}

// Design Specification ZoneHVAC Sizing Object Name: Optional Object
if (boost::optional<DesignSpecificationZoneHVACSizingName> designSpecificationZoneHVACSizingObject_ = modelObject.designSpecificationZoneHVACSizingObject()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(designSpecificationZoneHVACSizingObject_.get())) {
if (boost::optional<DesignSpecificationZoneHVACSizingName> designSpecificationZoneHVACSizingObject_ =
modelObject.designSpecificationZoneHVACSizingObject()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(designSpecificationZoneHVACSizingObject_.get())) {
idfObject.setString(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSpecificationZoneHVACSizingObjectName, wo_->nameString());
}
}
Expand Down
20 changes: 11 additions & 9 deletions src/energyplus/Test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,24 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_ZoneHVACEvaporativeCoolerUnit) {
EXPECT_TRUE(zoneHVACEvaporativeCoolerUnit.setDesignSpecificationZoneHVACSizingObject(designSpecificationZoneHVACSizingObject));
EXPECT_TRUE(zoneHVACEvaporativeCoolerUnit.setShutOffRelativeHumidity(95.0));


// TODO: you're responsible for creating all other objects needed so this object actually gets ForwardTranslated

const Workspace w = ft.translateModel(m);
const auto idfObjs = w.getObjectsByType(IddObjectType::ZoneHVAC_EvaporativeCoolerUnit);
ASSERT_EQ(1u, idfObjs.size());

const auto& idfObject = idfObjs.front();
EXPECT_EQ(availabilitySchedule.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityScheduleName).get());
EXPECT_EQ(availabilityManagerList.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityManagerListName).get());
EXPECT_EQ(outdoorAirInletNodeName.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::OutdoorAirInletNodeName).get());
EXPECT_EQ(coolerOutletNodeName.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerOutletNodeName).get());
EXPECT_EQ(zoneReliefAirNodeName.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::ZoneReliefAirNodeName).get());
EXPECT_EQ("Fan:SystemModel", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanObjectType).get()); EXPECT_EQ(supplyAirFan.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanName).get());
EXPECT_EQ(availabilitySchedule.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityScheduleName).get());
EXPECT_EQ(availabilityManagerList.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityManagerListName).get());
EXPECT_EQ(outdoorAirInletNodeName.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::OutdoorAirInletNodeName).get());
EXPECT_EQ(coolerOutletNodeName.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerOutletNodeName).get());
EXPECT_EQ(zoneReliefAirNodeName.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::ZoneReliefAirNodeName).get());
EXPECT_EQ("Fan:SystemModel", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanObjectType).get());
EXPECT_EQ(supplyAirFan.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanName).get());
// EXPECT_EQ("Autosize", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSupplyAirFlowRate).get()); EXPECT_EQ(0.9, idfObject.getDouble(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSupplyAirFlowRate).get()); EXPECT_EQ("BlowThrough", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::FanPlacement).get()); EXPECT_EQ("ZoneTemperatureDeadbandOnOffCycling", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerUnitControlMethod).get()); EXPECT_EQ(1.2, idfObject.getDouble(ZoneHVAC_EvaporativeCoolerUnitFields::ThrottlingRangeTemperatureDifference).get()); EXPECT_EQ(1.3, idfObject.getDouble(ZoneHVAC_EvaporativeCoolerUnitFields::CoolingLoadControlThresholdHeatTransferRate).get()); EXPECT_EQ("EvaporativeCooler:Direct:CelDekPad", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::FirstEvaporativeCoolerObjectType).get()); EXPECT_EQ(firstEvaporativeCoolerObject.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::FirstEvaporativeCoolerObjectName).get());
EXPECT_EQ("EvaporativeCooler:Direct:CelDekPad", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerObjectType).get()); EXPECT_EQ(secondEvaporativeCooler.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerName).get());
EXPECT_EQ(designSpecificationZoneHVACSizingObject.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSpecificationZoneHVACSizingObjectName).get());
EXPECT_EQ("EvaporativeCooler:Direct:CelDekPad", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerObjectType).get());
EXPECT_EQ(secondEvaporativeCooler.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerName).get());
EXPECT_EQ(designSpecificationZoneHVACSizingObject.nameString(),
idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSpecificationZoneHVACSizingObjectName).get());
EXPECT_EQ(95.0, idfObject.getDouble(ZoneHVAC_EvaporativeCoolerUnitFields::ShutOffRelativeHumidity).get());
}
4 changes: 4 additions & 0 deletions src/model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,9 @@ set(${target_name}_src
ZoneHVACEquipmentList.hpp
ZoneHVACEquipmentList_Impl.hpp
ZoneHVACEquipmentList.cpp
ZoneHVACEvaporativeCoolerUnit.hpp
ZoneHVACEvaporativeCoolerUnit_Impl.hpp
ZoneHVACEvaporativeCoolerUnit.cpp
ZoneHVACFourPipeFanCoil.hpp
ZoneHVACFourPipeFanCoil_Impl.hpp
ZoneHVACFourPipeFanCoil.cpp
Expand Down Expand Up @@ -2365,6 +2368,7 @@ set(${target_name}_test_src
test/ZoneHVACEnergyRecoveryVentilator_GTest.cpp
test/ZoneHVACEnergyRecoveryVentilatorController_GTest.cpp
test/ZoneHVACEquipmentList_GTest.cpp
test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp
test/ZoneHVACFourPipeFanCoil_GTest.cpp
test/ZoneHVACHighTemperatureRadiant_GTest.cpp
test/ZoneHVACLowTemperatureRadiantElectric_GTest.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/model/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4410,6 +4410,7 @@ namespace model {
REGISTER_CONSTRUCTOR(ZoneControlHumidistat);
REGISTER_CONSTRUCTOR(ZoneControlThermostatStagedDualSetpoint);
REGISTER_CONSTRUCTOR(ZoneHVACEquipmentList);
REGISTER_CONSTRUCTOR(ZoneHVACEvaporativeCoolerUnit);
REGISTER_CONSTRUCTOR(ZoneHVACBaseboardConvectiveElectric);
REGISTER_CONSTRUCTOR(ZoneHVACBaseboardConvectiveWater);
REGISTER_CONSTRUCTOR(ZoneHVACBaseboardRadiantConvectiveElectric);
Expand Down Expand Up @@ -4984,6 +4985,7 @@ namespace model {
REGISTER_COPYCONSTRUCTORS(ZoneControlHumidistat);
REGISTER_COPYCONSTRUCTORS(ZoneControlThermostatStagedDualSetpoint);
REGISTER_COPYCONSTRUCTORS(ZoneHVACEquipmentList);
REGISTER_COPYCONSTRUCTORS(ZoneHVACEvaporativeCoolerUnit);
REGISTER_COPYCONSTRUCTORS(ZoneHVACBaseboardConvectiveElectric);
REGISTER_COPYCONSTRUCTORS(ZoneHVACBaseboardConvectiveWater);
REGISTER_COPYCONSTRUCTORS(ZoneHVACBaseboardRadiantConvectiveElectric);
Expand Down
2 changes: 2 additions & 0 deletions src/model/ModelZoneHVAC.i
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ MODELOBJECT_TEMPLATES(ZoneHVACCoolingPanelRadiantConvectiveWater);
MODELOBJECT_TEMPLATES(ZoneHVACDehumidifierDX);
MODELOBJECT_TEMPLATES(ZoneHVACEnergyRecoveryVentilator);
MODELOBJECT_TEMPLATES(ZoneHVACEnergyRecoveryVentilatorController);
MODELOBJECT_TEMPLATES(ZoneHVACEvaporativeCoolerUnit);
MODELOBJECT_TEMPLATES(ZoneHVACFourPipeFanCoil);
MODELOBJECT_TEMPLATES(ZoneHVACHighTemperatureRadiant);
MODELOBJECT_TEMPLATES(ZoneHVACIdealLoadsAirSystem);
Expand All @@ -79,6 +80,7 @@ SWIG_MODELOBJECT(ZoneHVACCoolingPanelRadiantConvectiveWater,1);
SWIG_MODELOBJECT(ZoneHVACDehumidifierDX,1);
SWIG_MODELOBJECT(ZoneHVACEnergyRecoveryVentilator,1);
SWIG_MODELOBJECT(ZoneHVACEnergyRecoveryVentilatorController,1);
SWIG_MODELOBJECT(ZoneHVACEvaporativeCoolerUnit,1);
SWIG_MODELOBJECT(ZoneHVACFourPipeFanCoil,1);
SWIG_MODELOBJECT(ZoneHVACHighTemperatureRadiant,1);
SWIG_MODELOBJECT(ZoneHVACIdealLoadsAirSystem,1);
Expand Down
Loading

0 comments on commit 44f0405

Please sign in to comment.