src/energyplus/ForwardTranslator/ForwardTranslateCoilSystemIntegratedHeatPumpAirSource.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "../ForwardTranslator.hpp" | ||
| 7 | #include "../../model/CoilSystemIntegratedHeatPumpAirSource.hpp" | ||
| 8 | #include "../../model/CoilSystemIntegratedHeatPumpAirSource_Impl.hpp" | ||
| 9 | #include "../../model/Model.hpp" | ||
| 10 | #include <utilities/idd/CoilSystem_IntegratedHeatPump_AirSource_FieldEnums.hxx> | ||
| 11 | #include <utilities/idd/IddEnums.hxx> | ||
| 12 | #include <utilities/idd/IddFactory.hxx> | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | using namespace std; | ||
| 16 | |||
| 17 | namespace openstudio { | ||
| 18 | |||
| 19 | namespace energyplus { | ||
| 20 | |||
| 21 | 1 | boost::optional<IdfObject> ForwardTranslator::translateCoilSystemIntegratedHeatPumpAirSource(CoilSystemIntegratedHeatPumpAirSource& modelObject) { | |
| 22 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject(IddObjectType::CoilSystem_IntegratedHeatPump_AirSource); |
| 23 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(idfObject); |
| 24 | |||
| 25 | // Name | ||
| 26 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (auto s = modelObject.name()) { |
| 27 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setName(*s); |
| 28 | 1 | } | |
| 29 | |||
| 30 | 1 | boost::optional<std::string> s; | |
| 31 | 1 | boost::optional<double> value; | |
| 32 | 1 | boost::optional<int> i; | |
| 33 | |||
| 34 | // Space Cooling Coil Name | ||
| 35 | 1 | boost::optional<IdfObject> _spaceCoolingCoil; | |
| 36 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto spaceCoolingCoil = modelObject.spaceCoolingCoil(); |
| 37 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_spaceCoolingCoil = translateAndMapModelObject(spaceCoolingCoil))) { |
| 38 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SpaceCoolingCoilName, _spaceCoolingCoil->name().get()); |
| 39 | } | ||
| 40 | |||
| 41 | // Space Heating Coil Name | ||
| 42 | 1 | boost::optional<IdfObject> _spaceHeatingCoil; | |
| 43 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto spaceHeatingCoil = modelObject.spaceHeatingCoil(); |
| 44 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_spaceHeatingCoil = translateAndMapModelObject(spaceHeatingCoil))) { |
| 45 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SpaceHeatingCoilName, _spaceHeatingCoil->name().get()); |
| 46 | } | ||
| 47 | |||
| 48 | // Dedicated Water Heating Coil Name | ||
| 49 | 1 | boost::optional<IdfObject> _dedicatedWaterHeatingCoil; | |
| 50 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto dedicatedWaterHeatingCoil = modelObject.dedicatedWaterHeatingCoil(); |
| 51 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_dedicatedWaterHeatingCoil = translateAndMapModelObject(dedicatedWaterHeatingCoil))) { |
| 52 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::DedicatedWaterHeatingCoilName, _dedicatedWaterHeatingCoil->name().get()); |
| 53 | } | ||
| 54 | |||
| 55 | // SCWH Coil Name | ||
| 56 | 1 | boost::optional<IdfObject> _scwhCoil; | |
| 57 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto scwhCoil = modelObject.scwhCoil(); |
| 58 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_scwhCoil = translateAndMapModelObject(scwhCoil))) { |
| 59 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SCWHCoilName, _scwhCoil->name().get()); |
| 60 | } | ||
| 61 | |||
| 62 | // SCDWH Cooling Coil Name | ||
| 63 | 1 | boost::optional<IdfObject> _scdwhCoolingCoil; | |
| 64 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto scdwhCoolingCoil = modelObject.scdwhCoolingCoil(); |
| 65 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_scdwhCoolingCoil = translateAndMapModelObject(scdwhCoolingCoil))) { |
| 66 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SCDWHCoolingCoilName, _scdwhCoolingCoil->name().get()); |
| 67 | } | ||
| 68 | |||
| 69 | // SCDWH Water Heating Coil Name | ||
| 70 | 1 | boost::optional<IdfObject> _scdwhWaterHeatingCoil; | |
| 71 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto scdwhWaterHeatingCoil = modelObject.scdwhWaterHeatingCoil(); |
| 72 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_scdwhWaterHeatingCoil = translateAndMapModelObject(scdwhWaterHeatingCoil))) { |
| 73 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SCDWHWaterHeatingCoilName, _scdwhWaterHeatingCoil->name().get()); |
| 74 | } | ||
| 75 | |||
| 76 | // SHDWH Heating Coil Name | ||
| 77 | 1 | boost::optional<IdfObject> _shdwhHeatingCoil; | |
| 78 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto shdwhHeatingCoil = modelObject.shdwhHeatingCoil(); |
| 79 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_shdwhHeatingCoil = translateAndMapModelObject(shdwhHeatingCoil))) { |
| 80 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SHDWHHeatingCoilName, _shdwhHeatingCoil->name().get()); |
| 81 | } | ||
| 82 | |||
| 83 | // SHDWH Water Heating Coil Name | ||
| 84 | 1 | boost::optional<IdfObject> _shdwhWaterHeatingCoil; | |
| 85 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto shdwhWaterHeatingCoil = modelObject.shdwhWaterHeatingCoil(); |
| 86 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((_shdwhWaterHeatingCoil = translateAndMapModelObject(shdwhWaterHeatingCoil))) { |
| 87 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SHDWHWaterHeatingCoilName, _shdwhWaterHeatingCoil->name().get()); |
| 88 | } | ||
| 89 | |||
| 90 | // Indoor Temperature Limit for SCWH Mode | ||
| 91 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.indoorTemperatureLimitForSCWHMode())) { |
| 92 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(CoilSystem_IntegratedHeatPump_AirSourceFields::IndoorTemperatureLimitforSCWHMode, value.get()); |
| 93 | } | ||
| 94 | |||
| 95 | // Ambient Temperature Limit for SCWH Mode | ||
| 96 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.ambientTemperatureLimitForSCWHMode())) { |
| 97 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(CoilSystem_IntegratedHeatPump_AirSourceFields::AmbientTemperatureLimitforSCWHMode, value.get()); |
| 98 | } | ||
| 99 | |||
| 100 | // Indoor Temperature above Which WH has Higher Priority | ||
| 101 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.indoorTemperatureAboveWhichWHHasHigherPriority())) { |
| 102 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(CoilSystem_IntegratedHeatPump_AirSourceFields::IndoorTemperatureaboveWhichWHhasHigherPriority, value.get()); |
| 103 | } | ||
| 104 | |||
| 105 | // Ambient Temperature above Which WH has Higher Priority | ||
| 106 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.ambientTemperatureAboveWhichWHHasHigherPriority())) { |
| 107 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(CoilSystem_IntegratedHeatPump_AirSourceFields::AmbientTemperatureaboveWhichWHhasHigherPriority, value.get()); |
| 108 | } | ||
| 109 | |||
| 110 | // Flag to Indicate Load Control in SCWH Mode | ||
| 111 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((i = modelObject.flagtoIndicateLoadControlInSCWHMode())) { |
| 112 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setInt(CoilSystem_IntegratedHeatPump_AirSourceFields::FlagtoIndicateLoadControlinSCWHMode, i.get()); |
| 113 | } | ||
| 114 | |||
| 115 | // Minimum Speed Level for SCWH Mode | ||
| 116 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((i = modelObject.minimumSpeedLevelForSCWHMode())) { |
| 117 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setInt(CoilSystem_IntegratedHeatPump_AirSourceFields::MinimumSpeedLevelforSCWHMode, i.get()); |
| 118 | } | ||
| 119 | |||
| 120 | // Maximum Water Flow Volume before Switching from SCDWH to SCWH Mode | ||
| 121 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.maximumWaterFlowVolumeBeforeSwitchingfromSCDWHtoSCWHMode())) { |
| 122 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(CoilSystem_IntegratedHeatPump_AirSourceFields::MaximumWaterFlowVolumebeforeSwitchingfromSCDWHtoSCWHMode, value.get()); |
| 123 | } | ||
| 124 | |||
| 125 | // Minimum Speed Level for SCDWH Mode | ||
| 126 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((i = modelObject.minimumSpeedLevelForSCDWHMode())) { |
| 127 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setInt(CoilSystem_IntegratedHeatPump_AirSourceFields::MinimumSpeedLevelforSCDWHMode, i.get()); |
| 128 | } | ||
| 129 | |||
| 130 | // Maximum Running Time before Allowing Electric Resistance Heat Use during SHDWH Mode | ||
| 131 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.maximumRunningTimeBeforeAllowingElectricResistanceHeatUseDuringSHDWHMode())) { |
| 132 | 1 | idfObject.setDouble(CoilSystem_IntegratedHeatPump_AirSourceFields::MaximumRunningTimebeforeAllowingElectricResistanceHeatUseduringSHDWHMode, | |
| 133 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | value.get()); |
| 134 | } | ||
| 135 | |||
| 136 | // Minimum Speed Level for SHDWH Mode | ||
| 137 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((i = modelObject.minimumSpeedLevelForSHDWHMode())) { |
| 138 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setInt(CoilSystem_IntegratedHeatPump_AirSourceFields::MinimumSpeedLevelforSHDWHMode, i.get()); |
| 139 | } | ||
| 140 | |||
| 141 |
1/1✓ Branch 1 taken 1 time.
|
2 | return idfObject; |
| 142 | 1 | } | |
| 143 | |||
| 144 | } // namespace energyplus | ||
| 145 | } // namespace openstudio | ||
| 146 |