Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CoilSystem:Cooling:Water #5350

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from
2 changes: 2 additions & 0 deletions src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ set(${target_name}_test_src
Test/CoilCoolingDXTwoSpeed_GTest.cpp
Test/CoilCoolingDXTwoStageWithHumidityControlMode_GTest.cpp
Test/CoilCoolingDXVariableSpeed_GTest.cpp
Test/CoilCoolingWater_GTest.cpp
Test/CoilCoolingWaterToAirHeatPumpEquationFit_GTest.cpp
Test/CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_GTest.cpp
Test/CoilHeatingDXMultiSpeed_GTest.cpp
Expand All @@ -716,6 +717,7 @@ set(${target_name}_test_src
Test/CoilHeatingGasMultiStage_GTest.cpp
Test/CoilHeatingWaterToAirHeatPumpEquationFit_GTest.cpp
Test/CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFit_GTest.cpp
Test/CoilSystemCoolingWaterHeatExchangerAssisted_GTest.cpp
Test/CoilSystemIntegratedHeatPumpAirSource_GTest.cpp
Test/CoilUserDefined_GTest.cpp
Test/CoilWaterHeatingAirToWaterHeatPump_GTest.cpp
Expand Down
14 changes: 11 additions & 3 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,11 @@ namespace energyplus {
}
case openstudio::IddObjectType::OS_Coil_Cooling_Water: {
auto coil = modelObject.cast<CoilCoolingWater>();
retVal = translateCoilCoolingWater(coil);
if (isHVACComponentWithinUnitary(coil)) {
retVal = translateCoilCoolingWaterWithoutUnitary(coil);
} else {
retVal = translateCoilCoolingWater(coil);
}
break;
}
case openstudio::IddObjectType::OS_Coil_Cooling_Water_Panel_Radiant: {
Expand Down Expand Up @@ -1208,8 +1212,12 @@ namespace energyplus {
break;
}
case openstudio::IddObjectType::OS_CoilSystem_Cooling_Water_HeatExchangerAssisted: {
auto mo = modelObject.cast<CoilSystemCoolingWaterHeatExchangerAssisted>();
retVal = translateCoilSystemCoolingWaterHeatExchangerAssisted(mo);
auto coil = modelObject.cast<CoilSystemCoolingWaterHeatExchangerAssisted>();
if (isHVACComponentWithinUnitary(coil)) {
retVal = translateCoilSystemCoolingWaterHeatExchangerAssistedWithoutUnitary(coil);
} else {
retVal = translateCoilSystemCoolingWaterHeatExchangerAssisted(coil);
}
break;
}
case openstudio::IddObjectType::OS_CoilSystem_Cooling_DX_HeatExchangerAssisted: {
Expand Down
5 changes: 5 additions & 0 deletions src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,8 @@ namespace energyplus {

boost::optional<IdfObject> translateCoilCoolingWater(model::CoilCoolingWater& modelObject);

boost::optional<IdfObject> translateCoilCoolingWaterWithoutUnitary(model::CoilCoolingWater& modelObject);

boost::optional<IdfObject> translateCoilCoolingWaterToAirHeatPumpEquationFit(model::CoilCoolingWaterToAirHeatPumpEquationFit& modelObject);

boost::optional<IdfObject>
Expand Down Expand Up @@ -844,6 +846,9 @@ namespace energyplus {

boost::optional<IdfObject> translateCoilSystemCoolingWaterHeatExchangerAssisted(model::CoilSystemCoolingWaterHeatExchangerAssisted& modelObject);

boost::optional<IdfObject>
translateCoilSystemCoolingWaterHeatExchangerAssistedWithoutUnitary(model::CoilSystemCoolingWaterHeatExchangerAssisted& modelObject);

boost::optional<IdfObject> translateCoilSystemIntegratedHeatPumpAirSource(model::CoilSystemIntegratedHeatPumpAirSource& modelObject);

boost::optional<IdfObject> translateCoilUserDefined(model::CoilUserDefined& modelObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "../../model/CoilCoolingWater_Impl.hpp"
#include "../../utilities/core/Logger.hpp"
#include "../../utilities/core/Assert.hpp"
#include <utilities/idd/CoilSystem_Cooling_Water_FieldEnums.hxx>
#include <utilities/idd/Coil_Cooling_Water_FieldEnums.hxx>
#include "../../utilities/idd/IddEnums.hpp"
#include <utilities/idd/IddEnums.hxx>
Expand All @@ -26,7 +27,7 @@ namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingWater(CoilCoolingWater& modelObject) {
boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingWaterWithoutUnitary(model::CoilCoolingWater& modelObject) {
boost::optional<std::string> s;
boost::optional<double> value;

Expand Down Expand Up @@ -150,8 +151,55 @@ namespace energyplus {
return boost::optional<IdfObject>(idfObject);
}

//((Name)(Name))
//((AvailabilityScheduleName)(Availability Schedule Name))
boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingWater(CoilCoolingWater& modelObject) {
IdfObject coilSystemCoolingWaterIdf(IddObjectType::CoilSystem_Cooling_Water);

m_idfObjects.push_back(coilSystemCoolingWaterIdf);

boost::optional<IdfObject> oIdfObject = translateCoilCoolingWaterWithoutUnitary(modelObject);

if (!oIdfObject) {
return boost::none;
}

IdfObject idfObject = oIdfObject.get();

OptionalString s;

s = modelObject.name();
if (s) {
coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::CoolingCoilObjectType, idfObject.iddObject().name());

coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::CoolingCoilName, *s);

coilSystemCoolingWaterIdf.setName(*s + " CoilSystem");
}

Schedule sched = modelObject.availabilitySchedule();
translateAndMapModelObject(sched);

coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::AvailabilityScheduleName, sched.name().get());

OptionalModelObject omo = modelObject.airInletModelObject();
if (omo) {
translateAndMapModelObject(*omo);
s = omo->name();
if (s) {
coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::AirInletNodeName, *s);
}
}

omo = modelObject.airOutletModelObject();
if (omo) {
translateAndMapModelObject(*omo);
s = omo->name();
if (s) {
coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::AirOutletNodeName, *s);
}
}

return coilSystemCoolingWaterIdf;
}

} // namespace energyplus

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "../../model/Model.hpp"
#include "../../utilities/core/Assert.hpp"
#include <utilities/idd/CoilSystem_Cooling_Water_FieldEnums.hxx>
#include <utilities/idd/CoilSystem_Cooling_Water_HeatExchangerAssisted_FieldEnums.hxx>
#include <utilities/idd/HeatExchanger_AirToAir_SensibleAndLatent_FieldEnums.hxx>
#include <utilities/idd/Coil_Cooling_Water_FieldEnums.hxx>
Expand All @@ -41,8 +42,8 @@ namespace openstudio {

namespace energyplus {

boost::optional<IdfObject>
ForwardTranslator::translateCoilSystemCoolingWaterHeatExchangerAssisted(CoilSystemCoolingWaterHeatExchangerAssisted& modelObject) {
boost::optional<IdfObject> ForwardTranslator::translateCoilSystemCoolingWaterHeatExchangerAssistedWithoutUnitary(
model::CoilSystemCoolingWaterHeatExchangerAssisted& modelObject) {

IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::CoilSystem_Cooling_Water_HeatExchangerAssisted, modelObject);

Expand Down Expand Up @@ -157,5 +158,51 @@ namespace energyplus {
return idfObject;
}

boost::optional<IdfObject>
ForwardTranslator::translateCoilSystemCoolingWaterHeatExchangerAssisted(CoilSystemCoolingWaterHeatExchangerAssisted& modelObject) {
IdfObject coilSystemCoolingWaterIdf(IddObjectType::CoilSystem_Cooling_Water);

m_idfObjects.push_back(coilSystemCoolingWaterIdf);

boost::optional<IdfObject> oIdfObject = translateCoilSystemCoolingWaterHeatExchangerAssistedWithoutUnitary(modelObject);

if (!oIdfObject) {
return boost::none;
}

IdfObject idfObject = oIdfObject.get();

OptionalString s;

s = modelObject.name();
if (s) {
coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::CoolingCoilObjectType, idfObject.iddObject().name());

coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::CoolingCoilName, *s);

coilSystemCoolingWaterIdf.setName(*s + " CoilSystem");
}

OptionalModelObject omo = modelObject.inletModelObject();
if (omo) {
translateAndMapModelObject(*omo);
s = omo->name();
if (s) {
coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::AirInletNodeName, *s);
}
}

omo = modelObject.outletModelObject();
if (omo) {
translateAndMapModelObject(*omo);
s = omo->name();
if (s) {
coilSystemCoolingWaterIdf.setString(CoilSystem_Cooling_WaterFields::AirOutletNodeName, *s);
}
}

return coilSystemCoolingWaterIdf;
}

} // namespace energyplus
} // namespace openstudio
14 changes: 14 additions & 0 deletions src/energyplus/ForwardTranslator/ForwardTranslatePlantLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
#include "../../model/CoilCoolingCooledBeam_Impl.hpp"
#include "../../model/CoilCoolingFourPipeBeam.hpp"
#include "../../model/CoilCoolingFourPipeBeam_Impl.hpp"
#include "../../model/CoilCoolingWater.hpp"
#include "../../model/CoilCoolingWater_Impl.hpp"
#include "../../model/CoilHeatingFourPipeBeam.hpp"
#include "../../model/CoilHeatingFourPipeBeam_Impl.hpp"
#include "../../model/StraightComponent.hpp"
Expand Down Expand Up @@ -116,6 +118,7 @@
#include <utilities/idd/ZoneHVAC_AirDistributionUnit_FieldEnums.hxx>
#include <utilities/idd/FluidProperties_Name_FieldEnums.hxx>
#include <utilities/idd/AvailabilityManagerAssignmentList_FieldEnums.hxx>
#include <utilities/idd/CoilSystem_Cooling_Water_FieldEnums.hxx>
#include "../../utilities/core/Assert.hpp"

using namespace openstudio::model;
Expand Down Expand Up @@ -300,6 +303,17 @@ namespace energyplus {
if (loop.optionalCast<PlantLoop>()) {
inletNode = waterToAirComponent->waterInletModelObject()->optionalCast<Node>();
outletNode = waterToAirComponent->waterOutletModelObject()->optionalCast<Node>();
// Special case for Coil:Cooling:Water.
if (boost::optional<CoilCoolingWater> ccw = modelObject.optionalCast<CoilCoolingWater>()) {
boost::optional<IdfObject> idfCoil = this->translateAndMapModelObject(*ccw);
if (idfCoil) {
if (idfCoil->iddObject().type() == IddObjectType::CoilSystem_Cooling_Water) {
//Get the name and idd type of the coil cooling water inside the coil system
objectName = idfCoil->getString(CoilSystem_Cooling_WaterFields::CoolingCoilName).get();
iddType = idfCoil->getString(CoilSystem_Cooling_WaterFields::CoolingCoilObjectType).get();
}
}
}
} else {
inletNode = waterToAirComponent->airInletModelObject()->optionalCast<Node>();
outletNode = waterToAirComponent->airOutletModelObject()->optionalCast<Node>();
Expand Down
Loading