src/model/CoilCoolingFourPipeBeam.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 "CoilCoolingFourPipeBeam.hpp" | ||
| 7 | #include "CoilCoolingFourPipeBeam_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Node.hpp" | ||
| 10 | #include "Node_Impl.hpp" | ||
| 11 | #include "Curve.hpp" | ||
| 12 | #include "Curve_Impl.hpp" | ||
| 13 | #include "Model.hpp" | ||
| 14 | #include "PlantLoop.hpp" | ||
| 15 | #include "AirTerminalSingleDuctConstantVolumeFourPipeBeam.hpp" | ||
| 16 | #include "AirTerminalSingleDuctConstantVolumeFourPipeBeam_Impl.hpp" | ||
| 17 | |||
| 18 | // For Ctor default curves | ||
| 19 | #include "CurveLinear.hpp" | ||
| 20 | #include "TableLookup.hpp" | ||
| 21 | #include "TableIndependentVariable.hpp" | ||
| 22 | |||
| 23 | #include <utilities/idd/IddEnums.hxx> | ||
| 24 | #include <utilities/idd/OS_Coil_Cooling_FourPipeBeam_FieldEnums.hxx> | ||
| 25 | |||
| 26 | #include "../utilities/core/Assert.hpp" | ||
| 27 | #include "../utilities/data/DataEnums.hpp" | ||
| 28 | |||
| 29 | namespace openstudio { | ||
| 30 | namespace model { | ||
| 31 | |||
| 32 | namespace detail { | ||
| 33 | |||
| 34 | 10 | CoilCoolingFourPipeBeam_Impl::CoilCoolingFourPipeBeam_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 35 | 10 | : StraightComponent_Impl(idfObject, model, keepHandle) { | |
| 36 |
4/6✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 10 times.
✗ Branch 13 not taken.
|
10 | OS_ASSERT(idfObject.iddObject().type() == CoilCoolingFourPipeBeam::iddObjectType()); |
| 37 | 10 | } | |
| 38 | |||
| 39 | ✗ | CoilCoolingFourPipeBeam_Impl::CoilCoolingFourPipeBeam_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 40 | ✗ | bool keepHandle) | |
| 41 | ✗ | : StraightComponent_Impl(other, model, keepHandle) { | |
| 42 | ✗ | OS_ASSERT(other.iddObject().type() == CoilCoolingFourPipeBeam::iddObjectType()); | |
| 43 | ✗ | } | |
| 44 | |||
| 45 | 7 | CoilCoolingFourPipeBeam_Impl::CoilCoolingFourPipeBeam_Impl(const CoilCoolingFourPipeBeam_Impl& other, Model_Impl* model, bool keepHandle) | |
| 46 | 7 | : StraightComponent_Impl(other, model, keepHandle) {} | |
| 47 | |||
| 48 | ✗ | const std::vector<std::string>& CoilCoolingFourPipeBeam_Impl::outputVariableNames() const { | |
| 49 | ✗ | static const std::vector<std::string> result; | |
| 50 | // None: all in parent AirTerminalSingleDuctConstantVolumeFourPipeBeam | ||
| 51 | ✗ | return result; | |
| 52 | } | ||
| 53 | |||
| 54 | ✗ | IddObjectType CoilCoolingFourPipeBeam_Impl::iddObjectType() const { | |
| 55 | ✗ | return CoilCoolingFourPipeBeam::iddObjectType(); | |
| 56 | } | ||
| 57 | |||
| 58 | 13 | unsigned CoilCoolingFourPipeBeam_Impl::inletPort() const { | |
| 59 | 13 | return OS_Coil_Cooling_FourPipeBeamFields::ChilledWaterInletNodeName; | |
| 60 | } | ||
| 61 | |||
| 62 | 52 | unsigned CoilCoolingFourPipeBeam_Impl::outletPort() const { | |
| 63 | 52 | return OS_Coil_Cooling_FourPipeBeamFields::ChilledWaterOutletNodeName; | |
| 64 | } | ||
| 65 | |||
| 66 | // contaningHVACComponent is important: used for airLoopHVAC::addBranchForZone to connect the coil to the right loop | ||
| 67 | 1 | boost::optional<HVACComponent> CoilCoolingFourPipeBeam_Impl::containingHVACComponent() const { | |
| 68 | // return this->airTerminalSingleDuctConstantVolumeFourPipeBeam(); | ||
| 69 | 1 | std::vector<AirTerminalSingleDuctConstantVolumeFourPipeBeam> atuFourPipeBeams; | |
| 70 | |||
| 71 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | atuFourPipeBeams = this->model().getConcreteModelObjects<AirTerminalSingleDuctConstantVolumeFourPipeBeam>(); |
| 72 | |||
| 73 |
1/2✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
|
2 | for (const auto& elem : atuFourPipeBeams) { |
| 74 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<HVACComponent> coil = elem.coolingCoil()) { |
| 75 |
6/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 12 taken 1 time.
✓ Branch 13 taken 1 time.
|
2 | if (coil->handle() == this->handle()) { |
| 76 |
1/1✓ Branch 1 taken 1 time.
|
1 | return elem; |
| 77 | } | ||
| 78 | 2 | } | |
| 79 | } | ||
| 80 | ✗ | return boost::none; | |
| 81 | 1 | } | |
| 82 | |||
| 83 | 1 | boost::optional<StraightComponent> CoilCoolingFourPipeBeam_Impl::containingStraightComponent() const { | |
| 84 | // return this->airTerminalSingleDuctConstantVolumeFourPipeBeam(); | ||
| 85 | 1 | std::vector<AirTerminalSingleDuctConstantVolumeFourPipeBeam> atuFourPipeBeams; | |
| 86 | |||
| 87 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | atuFourPipeBeams = this->model().getConcreteModelObjects<AirTerminalSingleDuctConstantVolumeFourPipeBeam>(); |
| 88 | |||
| 89 |
1/2✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
1 | for (const auto& elem : atuFourPipeBeams) { |
| 90 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<HVACComponent> coil = elem.coolingCoil()) { |
| 91 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
|
1 | if (coil->handle() == this->handle()) { |
| 92 |
1/1✓ Branch 1 taken 1 time.
|
1 | return elem; |
| 93 | } | ||
| 94 | 1 | } | |
| 95 | } | ||
| 96 | ✗ | return boost::none; | |
| 97 | 1 | } | |
| 98 | |||
| 99 | /* Only allow connection on the demand side of a plantLoop */ | ||
| 100 | 7 | bool CoilCoolingFourPipeBeam_Impl::addToNode(Node& node) { | |
| 101 |
2/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
|
14 | if (boost::optional<PlantLoop> plant = node.plantLoop()) { |
| 102 |
5/5✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 6 times.
✓ Branch 11 taken 1 time.
|
14 | if (plant->demandComponent(node.handle())) { |
| 103 |
1/1✓ Branch 1 taken 6 times.
|
6 | return StraightComponent_Impl::addToNode(node); |
| 104 | } | ||
| 105 | 7 | } | |
| 106 | |||
| 107 | 1 | return false; | |
| 108 | } | ||
| 109 | |||
| 110 | /* Nodes */ | ||
| 111 | |||
| 112 | 7 | boost::optional<Node> CoilCoolingFourPipeBeam_Impl::chilledWaterInletNode() const { | |
| 113 | // TODO: use this once port methods are set to const | ||
| 114 | // unsigned port = inletPort(); | ||
| 115 | 7 | unsigned port = OS_Coil_Cooling_FourPipeBeamFields::ChilledWaterInletNodeName; | |
| 116 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<ModelObject> mo = connectedObject(port); |
| 117 | 7 | boost::optional<Node> result; | |
| 118 | |||
| 119 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
|
7 | if (mo) { |
| 120 |
3/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 6 taken 6 times.
✗ Branch 7 not taken.
|
12 | if (boost::optional<Node> node = mo->optionalCast<Node>()) { |
| 121 |
1/1✓ Branch 1 taken 6 times.
|
6 | result = node; |
| 122 | 6 | } | |
| 123 | } | ||
| 124 | |||
| 125 | 14 | return result; | |
| 126 | 7 | } | |
| 127 | |||
| 128 | 7 | boost::optional<Node> CoilCoolingFourPipeBeam_Impl::chilledWaterOutletNode() const { | |
| 129 | // TODO: use this once port methods are set to const | ||
| 130 | // unsigned port = outletPort(); | ||
| 131 | 7 | unsigned port = OS_Coil_Cooling_FourPipeBeamFields::ChilledWaterOutletNodeName; | |
| 132 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<ModelObject> mo = connectedObject(port); |
| 133 | 7 | boost::optional<Node> result; | |
| 134 | |||
| 135 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
|
7 | if (mo) { |
| 136 |
3/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 6 taken 6 times.
✗ Branch 7 not taken.
|
12 | if (boost::optional<Node> node = mo->optionalCast<Node>()) { |
| 137 |
1/1✓ Branch 1 taken 6 times.
|
6 | result = node; |
| 138 | 6 | } | |
| 139 | } | ||
| 140 | |||
| 141 | 14 | return result; | |
| 142 | 7 | } | |
| 143 | |||
| 144 | /* double with default fields */ | ||
| 145 | |||
| 146 | // Beam Rated Cooling Capacity per Beam Length | ||
| 147 | |||
| 148 | 2 | double CoilCoolingFourPipeBeam_Impl::beamRatedCoolingCapacityperBeamLength() const { | |
| 149 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<double> value = getDouble(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingCapacityperBeamLength, true); |
| 150 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 151 |
1/1✓ Branch 1 taken 2 times.
|
4 | return value.get(); |
| 152 | } | ||
| 153 | |||
| 154 | 2 | bool CoilCoolingFourPipeBeam_Impl::isBeamRatedCoolingCapacityperBeamLengthDefaulted() const { | |
| 155 | 2 | return isEmpty(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingCapacityperBeamLength); | |
| 156 | } | ||
| 157 | |||
| 158 | 1 | bool CoilCoolingFourPipeBeam_Impl::setBeamRatedCoolingCapacityperBeamLength(double beamRatedCoolingCapacityperBeamLength) { | |
| 159 | 1 | bool result = setDouble(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingCapacityperBeamLength, beamRatedCoolingCapacityperBeamLength); | |
| 160 | 1 | return result; | |
| 161 | } | ||
| 162 | |||
| 163 | 1 | void CoilCoolingFourPipeBeam_Impl::resetBeamRatedCoolingCapacityperBeamLength() { | |
| 164 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingCapacityperBeamLength, ""); |
| 165 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 166 | 1 | } | |
| 167 | |||
| 168 | // Beam Rated Cooling Room Air Chilled Water Temperature Difference | ||
| 169 | |||
| 170 | 2 | double CoilCoolingFourPipeBeam_Impl::beamRatedCoolingRoomAirChilledWaterTemperatureDifference() const { | |
| 171 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<double> value = getDouble(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingRoomAirChilledWaterTemperatureDifference, true); |
| 172 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 173 |
1/1✓ Branch 1 taken 2 times.
|
4 | return value.get(); |
| 174 | } | ||
| 175 | |||
| 176 | 2 | bool CoilCoolingFourPipeBeam_Impl::isBeamRatedCoolingRoomAirChilledWaterTemperatureDifferenceDefaulted() const { | |
| 177 | 2 | return isEmpty(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingRoomAirChilledWaterTemperatureDifference); | |
| 178 | } | ||
| 179 | |||
| 180 | 1 | bool CoilCoolingFourPipeBeam_Impl::setBeamRatedCoolingRoomAirChilledWaterTemperatureDifference( | |
| 181 | double beamRatedCoolingRoomAirChilledWaterTemperatureDifference) { | ||
| 182 | 1 | bool result = setDouble(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingRoomAirChilledWaterTemperatureDifference, | |
| 183 | beamRatedCoolingRoomAirChilledWaterTemperatureDifference); | ||
| 184 | 1 | return result; | |
| 185 | } | ||
| 186 | |||
| 187 | 1 | void CoilCoolingFourPipeBeam_Impl::resetBeamRatedCoolingRoomAirChilledWaterTemperatureDifference() { | |
| 188 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedCoolingRoomAirChilledWaterTemperatureDifference, ""); |
| 189 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 190 | 1 | } | |
| 191 | |||
| 192 | // Beam Rated Chilled Water Volume Flow Rate per Beam Length | ||
| 193 | |||
| 194 | 2 | double CoilCoolingFourPipeBeam_Impl::beamRatedChilledWaterVolumeFlowRateperBeamLength() const { | |
| 195 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<double> value = getDouble(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedChilledWaterVolumeFlowRateperBeamLength, true); |
| 196 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 197 |
1/1✓ Branch 1 taken 2 times.
|
4 | return value.get(); |
| 198 | } | ||
| 199 | |||
| 200 | 2 | bool CoilCoolingFourPipeBeam_Impl::isBeamRatedChilledWaterVolumeFlowRateperBeamLengthDefaulted() const { | |
| 201 | 2 | return isEmpty(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedChilledWaterVolumeFlowRateperBeamLength); | |
| 202 | } | ||
| 203 | |||
| 204 | 1 | bool CoilCoolingFourPipeBeam_Impl::setBeamRatedChilledWaterVolumeFlowRateperBeamLength(double beamRatedChilledWaterVolumeFlowRateperBeamLength) { | |
| 205 | 1 | bool result = setDouble(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedChilledWaterVolumeFlowRateperBeamLength, | |
| 206 | beamRatedChilledWaterVolumeFlowRateperBeamLength); | ||
| 207 | 1 | return result; | |
| 208 | } | ||
| 209 | |||
| 210 | 1 | void CoilCoolingFourPipeBeam_Impl::resetBeamRatedChilledWaterVolumeFlowRateperBeamLength() { | |
| 211 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Coil_Cooling_FourPipeBeamFields::BeamRatedChilledWaterVolumeFlowRateperBeamLength, ""); |
| 212 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 213 | 1 | } | |
| 214 | |||
| 215 | /* Curves */ | ||
| 216 | |||
| 217 | // Beam Cooling Capacity Temperature Difference Modification Factor Curve | ||
| 218 | |||
| 219 | 4 | Curve CoilCoolingFourPipeBeam_Impl::beamCoolingCapacityTemperatureDifferenceModificationFactorCurve() const { | |
| 220 |
1/1✓ Branch 1 taken 4 times.
|
8 | boost::optional<Curve> c = getObject<ModelObject>().getModelObjectTarget<Curve>( |
| 221 |
1/1✓ Branch 1 taken 4 times.
|
4 | OS_Coil_Cooling_FourPipeBeamFields::BeamCoolingCapacityTemperatureDifferenceModificationFactorCurveName); |
| 222 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
|
4 | if (!c) { |
| 223 | ✗ | LOG_AND_THROW(briefDescription() << " doesn't have the required Beam Cooling Capacity Temperature Difference Modification Factor Curve"); | |
| 224 | } | ||
| 225 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(c); |
| 226 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | return c.get(); |
| 227 | 4 | } | |
| 228 | |||
| 229 | 11 | bool CoilCoolingFourPipeBeam_Impl::setBeamCoolingCapacityTemperatureDifferenceModificationFactorCurve(const Curve& curve) { | |
| 230 | bool result = | ||
| 231 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | setPointer(OS_Coil_Cooling_FourPipeBeamFields::BeamCoolingCapacityTemperatureDifferenceModificationFactorCurveName, curve.handle()); |
| 232 | 11 | return result; | |
| 233 | } | ||
| 234 | |||
| 235 | // Beam Cooling Capacity Air Flow Modification Factor Curve | ||
| 236 | |||
| 237 | 4 | Curve CoilCoolingFourPipeBeam_Impl::beamCoolingCapacityAirFlowModificationFactorCurve() const { | |
| 238 |
1/1✓ Branch 1 taken 4 times.
|
8 | boost::optional<Curve> c = getObject<ModelObject>().getModelObjectTarget<Curve>( |
| 239 |
1/1✓ Branch 1 taken 4 times.
|
4 | OS_Coil_Cooling_FourPipeBeamFields::BeamCoolingCapacityAirFlowModificationFactorCurveName); |
| 240 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
|
4 | if (!c) { |
| 241 | ✗ | LOG_AND_THROW(briefDescription() << " doesn't have the required Beam Cooling Capacity Air Flow Modification Factor Curve"); | |
| 242 | } | ||
| 243 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(c); |
| 244 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | return c.get(); |
| 245 | 4 | } | |
| 246 | |||
| 247 | 11 | bool CoilCoolingFourPipeBeam_Impl::setBeamCoolingCapacityAirFlowModificationFactorCurve(const Curve& curve) { | |
| 248 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | bool result = setPointer(OS_Coil_Cooling_FourPipeBeamFields::BeamCoolingCapacityAirFlowModificationFactorCurveName, curve.handle()); |
| 249 | 11 | return result; | |
| 250 | } | ||
| 251 | |||
| 252 | // Beam Cooling Capacity Chilled Water Flow Modification Factor Curve | ||
| 253 | |||
| 254 | 4 | Curve CoilCoolingFourPipeBeam_Impl::beamCoolingCapacityChilledWaterFlowModificationFactorCurve() const { | |
| 255 |
1/1✓ Branch 1 taken 4 times.
|
8 | boost::optional<Curve> c = getObject<ModelObject>().getModelObjectTarget<Curve>( |
| 256 |
1/1✓ Branch 1 taken 4 times.
|
4 | OS_Coil_Cooling_FourPipeBeamFields::BeamCoolingCapacityChilledWaterFlowModificationFactorCurveName); |
| 257 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
|
4 | if (!c) { |
| 258 | ✗ | LOG_AND_THROW(briefDescription() << " doesn't have the required Beam Cooling Capacity Chilled Water Flow Modification Factor Curve"); | |
| 259 | } | ||
| 260 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(c); |
| 261 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | return c.get(); |
| 262 | 4 | } | |
| 263 | |||
| 264 | 11 | bool CoilCoolingFourPipeBeam_Impl::setBeamCoolingCapacityChilledWaterFlowModificationFactorCurve(const Curve& curve) { | |
| 265 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | bool result = setPointer(OS_Coil_Cooling_FourPipeBeamFields::BeamCoolingCapacityChilledWaterFlowModificationFactorCurveName, curve.handle()); |
| 266 | 11 | return result; | |
| 267 | } | ||
| 268 | |||
| 269 | /* Convenience functions */ | ||
| 270 | |||
| 271 | boost::optional<AirTerminalSingleDuctConstantVolumeFourPipeBeam> | ||
| 272 | ✗ | CoilCoolingFourPipeBeam_Impl::airTerminalSingleDuctConstantVolumeFourPipeBeam() const { | |
| 273 | // this coil can only be found in a AirTerminalSingleDuctConstantVolumeFourPipeBeam | ||
| 274 | // check all AirTerminalSingleDuctConstantVolumeFourPipeBeam in the models, seeing if this coil | ||
| 275 | // is inside of one of them. Return the one it is inside of. | ||
| 276 | |||
| 277 | ✗ | std::vector<AirTerminalSingleDuctConstantVolumeFourPipeBeam> atuFourPipeBeams; | |
| 278 | |||
| 279 | ✗ | atuFourPipeBeams = this->model().getConcreteModelObjects<AirTerminalSingleDuctConstantVolumeFourPipeBeam>(); | |
| 280 | |||
| 281 | ✗ | for (const auto& elem : atuFourPipeBeams) { | |
| 282 | ✗ | if (boost::optional<HVACComponent> coil = elem.coolingCoil()) { | |
| 283 | ✗ | if (coil->handle() == this->handle()) { | |
| 284 | ✗ | return elem; | |
| 285 | } | ||
| 286 | ✗ | } | |
| 287 | } | ||
| 288 | ✗ | return boost::none; | |
| 289 | ✗ | } | |
| 290 | |||
| 291 | ✗ | ComponentType CoilCoolingFourPipeBeam_Impl::componentType() const { | |
| 292 | ✗ | return ComponentType::Cooling; | |
| 293 | } | ||
| 294 | |||
| 295 | ✗ | std::vector<FuelType> CoilCoolingFourPipeBeam_Impl::coolingFuelTypes() const { | |
| 296 | ✗ | if (auto p_ = plantLoop()) { | |
| 297 | ✗ | return p_->coolingFuelTypes(); | |
| 298 | ✗ | } | |
| 299 | ✗ | return {}; | |
| 300 | } | ||
| 301 | |||
| 302 | ✗ | std::vector<FuelType> CoilCoolingFourPipeBeam_Impl::heatingFuelTypes() const { | |
| 303 | ✗ | return {}; | |
| 304 | } | ||
| 305 | |||
| 306 | ✗ | std::vector<AppGFuelType> CoilCoolingFourPipeBeam_Impl::appGHeatingFuelTypes() const { | |
| 307 | ✗ | return {}; | |
| 308 | } | ||
| 309 | |||
| 310 | } // namespace detail | ||
| 311 | |||
| 312 | /* Ctor: defaulting Curves like in the FourPipeBeamLargeOffice.idf Example File from E+ */ | ||
| 313 | 10 | CoilCoolingFourPipeBeam::CoilCoolingFourPipeBeam(const Model& model) : StraightComponent(CoilCoolingFourPipeBeam::iddObjectType(), model) { | |
| 314 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 10 times.
✗ Branch 5 not taken.
|
10 | OS_ASSERT(getImpl<detail::CoilCoolingFourPipeBeam_Impl>()); |
| 315 | |||
| 316 | 10 | bool ok = true; | |
| 317 | |||
| 318 | //Beam Cooling Capacity Temperature Difference Modification Factor Curve Nam | ||
| 319 |
1/1✓ Branch 1 taken 10 times.
|
10 | CurveLinear capModFuncOfTempDiff(model); |
| 320 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | capModFuncOfTempDiff.setName("CapModFuncOfTempDiff"); |
| 321 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfTempDiff.setCoefficient1Constant(0); |
| 322 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfTempDiff.setCoefficient2x(1); |
| 323 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfTempDiff.setMinimumValueofx(0.0); |
| 324 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfTempDiff.setMaximumValueofx(1.5); |
| 325 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfTempDiff.setMinimumCurveOutput(0.0); |
| 326 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfTempDiff.setMaximumCurveOutput(1.5); |
| 327 | |||
| 328 |
1/1✓ Branch 1 taken 10 times.
|
10 | ok = setBeamCoolingCapacityTemperatureDifferenceModificationFactorCurve(capModFuncOfTempDiff); |
| 329 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
|
10 | OS_ASSERT(ok); |
| 330 | |||
| 331 | // Beam Cooling Capacity Air Flow Modification Factor Curve Name | ||
| 332 |
1/1✓ Branch 1 taken 10 times.
|
10 | TableLookup coolCapModFuncOfSAFlow(model); |
| 333 | { | ||
| 334 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | coolCapModFuncOfSAFlow.setName("CoolCapModFuncOfSAFlow"); |
| 335 |
1/1✓ Branch 1 taken 10 times.
|
10 | coolCapModFuncOfSAFlow.setMinimumOutput(0.8234); |
| 336 |
1/1✓ Branch 1 taken 10 times.
|
10 | coolCapModFuncOfSAFlow.setMaximumOutput(1.1256); |
| 337 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | coolCapModFuncOfSAFlow.setOutputUnitType("Dimensionless"); |
| 338 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | coolCapModFuncOfSAFlow.setOutputValues({0.823403, 1.0, 1.1256}); |
| 339 | |||
| 340 |
1/1✓ Branch 1 taken 10 times.
|
10 | TableIndependentVariable coolCapModFuncOfSAFlowVar1(model); |
| 341 |
1/1✓ Branch 1 taken 10 times.
|
10 | coolCapModFuncOfSAFlow.addIndependentVariable(coolCapModFuncOfSAFlowVar1); |
| 342 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | coolCapModFuncOfSAFlowVar1.setName("CoolCapModFuncOfWaterFlow_IndependentVariable1"); |
| 343 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | coolCapModFuncOfSAFlowVar1.setInterpolationMethod("Cubic"); |
| 344 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | coolCapModFuncOfSAFlowVar1.setExtrapolationMethod("Constant"); |
| 345 |
1/1✓ Branch 1 taken 10 times.
|
10 | coolCapModFuncOfSAFlowVar1.setMinimumValue(0.714); |
| 346 |
1/1✓ Branch 1 taken 10 times.
|
10 | coolCapModFuncOfSAFlowVar1.setMaximumValue(1.2857); |
| 347 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | coolCapModFuncOfSAFlowVar1.setUnitType("Dimensionless"); |
| 348 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | coolCapModFuncOfSAFlowVar1.setValues({0.714286, 1.0, 1.2857}); |
| 349 | 10 | } | |
| 350 | |||
| 351 |
1/1✓ Branch 1 taken 10 times.
|
10 | ok = setBeamCoolingCapacityAirFlowModificationFactorCurve(coolCapModFuncOfSAFlow); |
| 352 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
|
10 | OS_ASSERT(ok); |
| 353 | |||
| 354 | // Beam Cooling Capacity Chilled Water Flow Modification Factor Curve | ||
| 355 | // CapModFuncOfWaterFlow: Table:OneIndependentVariable | ||
| 356 | |||
| 357 |
1/1✓ Branch 1 taken 10 times.
|
10 | TableLookup capModFuncOfWaterFlow(model); |
| 358 | { | ||
| 359 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | capModFuncOfWaterFlow.setName("CoolCapModFuncOfWaterFlow"); |
| 360 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfWaterFlow.setMinimumOutput(0.0); |
| 361 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfWaterFlow.setMaximumOutput(1.04); |
| 362 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | capModFuncOfWaterFlow.setOutputUnitType("Dimensionless"); |
| 363 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | capModFuncOfWaterFlow.setOutputValues({0.0, 0.001, 0.71, 0.85, 0.92, 0.97, 1.0, 1.04}); |
| 364 | |||
| 365 |
1/1✓ Branch 1 taken 10 times.
|
10 | TableIndependentVariable capModFuncOfWaterFlowVar1(model); |
| 366 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfWaterFlow.addIndependentVariable(capModFuncOfWaterFlowVar1); |
| 367 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | capModFuncOfWaterFlowVar1.setName("CoolCapModFuncOfWaterFlow_IndependentVariable1"); |
| 368 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | capModFuncOfWaterFlowVar1.setInterpolationMethod("Cubic"); |
| 369 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | capModFuncOfWaterFlowVar1.setExtrapolationMethod("Constant"); |
| 370 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfWaterFlowVar1.setMinimumValue(0.0); |
| 371 |
1/1✓ Branch 1 taken 10 times.
|
10 | capModFuncOfWaterFlowVar1.setMaximumValue(1.33); |
| 372 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | capModFuncOfWaterFlowVar1.setUnitType("Dimensionless"); |
| 373 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
20 | capModFuncOfWaterFlowVar1.setValues({0.0, 0.05, 0.33333, 0.5, 0.666667, 0.833333, 1.0, 1.333333}); |
| 374 | 10 | } | |
| 375 | |||
| 376 |
1/1✓ Branch 1 taken 10 times.
|
10 | ok = setBeamCoolingCapacityChilledWaterFlowModificationFactorCurve(capModFuncOfWaterFlow); |
| 377 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
|
10 | OS_ASSERT(ok); |
| 378 | 10 | } | |
| 379 | |||
| 380 | 7622 | IddObjectType CoilCoolingFourPipeBeam::iddObjectType() { | |
| 381 |
1/1✓ Branch 1 taken 7622 times.
|
7622 | return {IddObjectType::OS_Coil_Cooling_FourPipeBeam}; |
| 382 | } | ||
| 383 | |||
| 384 | /* Nodes */ | ||
| 385 | 7 | boost::optional<Node> CoilCoolingFourPipeBeam::chilledWaterInletNode() const { | |
| 386 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->chilledWaterInletNode(); |
| 387 | } | ||
| 388 | |||
| 389 | 7 | boost::optional<Node> CoilCoolingFourPipeBeam::chilledWaterOutletNode() const { | |
| 390 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->chilledWaterOutletNode(); |
| 391 | } | ||
| 392 | |||
| 393 | /* double with default fields */ | ||
| 394 | |||
| 395 | // Beam Rated Cooling Capacity per Beam Length | ||
| 396 | |||
| 397 | 2 | double CoilCoolingFourPipeBeam::beamRatedCoolingCapacityperBeamLength() const { | |
| 398 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->beamRatedCoolingCapacityperBeamLength(); |
| 399 | } | ||
| 400 | |||
| 401 | 2 | bool CoilCoolingFourPipeBeam::isBeamRatedCoolingCapacityperBeamLengthDefaulted() const { | |
| 402 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->isBeamRatedCoolingCapacityperBeamLengthDefaulted(); |
| 403 | } | ||
| 404 | |||
| 405 | 1 | bool CoilCoolingFourPipeBeam::setBeamRatedCoolingCapacityperBeamLength(double beamRatedCoolingCapacityperBeamLength) { | |
| 406 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->setBeamRatedCoolingCapacityperBeamLength(beamRatedCoolingCapacityperBeamLength); |
| 407 | } | ||
| 408 | |||
| 409 | 1 | void CoilCoolingFourPipeBeam::resetBeamRatedCoolingCapacityperBeamLength() { | |
| 410 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->resetBeamRatedCoolingCapacityperBeamLength(); |
| 411 | 1 | } | |
| 412 | |||
| 413 | // Beam Rated Cooling Room Air Chilled Water Temperature Difference | ||
| 414 | |||
| 415 | 2 | double CoilCoolingFourPipeBeam::beamRatedCoolingRoomAirChilledWaterTemperatureDifference() const { | |
| 416 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->beamRatedCoolingRoomAirChilledWaterTemperatureDifference(); |
| 417 | } | ||
| 418 | |||
| 419 | 2 | bool CoilCoolingFourPipeBeam::isBeamRatedCoolingRoomAirChilledWaterTemperatureDifferenceDefaulted() const { | |
| 420 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->isBeamRatedCoolingRoomAirChilledWaterTemperatureDifferenceDefaulted(); |
| 421 | } | ||
| 422 | |||
| 423 | 1 | bool CoilCoolingFourPipeBeam::setBeamRatedCoolingRoomAirChilledWaterTemperatureDifference( | |
| 424 | double beamRatedCoolingRoomAirChilledWaterTemperatureDifference) { | ||
| 425 |
1/1✓ Branch 3 taken 1 time.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->setBeamRatedCoolingRoomAirChilledWaterTemperatureDifference( |
| 426 | 2 | beamRatedCoolingRoomAirChilledWaterTemperatureDifference); | |
| 427 | } | ||
| 428 | |||
| 429 | 1 | void CoilCoolingFourPipeBeam::resetBeamRatedCoolingRoomAirChilledWaterTemperatureDifference() { | |
| 430 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->resetBeamRatedCoolingRoomAirChilledWaterTemperatureDifference(); |
| 431 | 1 | } | |
| 432 | |||
| 433 | // Beam Rated Chilled Water Volume Flow Rate per Beam Length | ||
| 434 | |||
| 435 | 2 | double CoilCoolingFourPipeBeam::beamRatedChilledWaterVolumeFlowRateperBeamLength() const { | |
| 436 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->beamRatedChilledWaterVolumeFlowRateperBeamLength(); |
| 437 | } | ||
| 438 | |||
| 439 | 2 | bool CoilCoolingFourPipeBeam::isBeamRatedChilledWaterVolumeFlowRateperBeamLengthDefaulted() const { | |
| 440 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->isBeamRatedChilledWaterVolumeFlowRateperBeamLengthDefaulted(); |
| 441 | } | ||
| 442 | |||
| 443 | 1 | bool CoilCoolingFourPipeBeam::setBeamRatedChilledWaterVolumeFlowRateperBeamLength(double beamRatedChilledWaterVolumeFlowRateperBeamLength) { | |
| 444 |
1/1✓ Branch 3 taken 1 time.
|
2 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->setBeamRatedChilledWaterVolumeFlowRateperBeamLength( |
| 445 | 2 | beamRatedChilledWaterVolumeFlowRateperBeamLength); | |
| 446 | } | ||
| 447 | |||
| 448 | 1 | void CoilCoolingFourPipeBeam::resetBeamRatedChilledWaterVolumeFlowRateperBeamLength() { | |
| 449 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->resetBeamRatedChilledWaterVolumeFlowRateperBeamLength(); |
| 450 | 1 | } | |
| 451 | |||
| 452 | /* Curves */ | ||
| 453 | |||
| 454 | // Beam Cooling Capacity Temperature Difference Modification Factor Curve | ||
| 455 | 4 | Curve CoilCoolingFourPipeBeam::beamCoolingCapacityTemperatureDifferenceModificationFactorCurve() const { | |
| 456 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->beamCoolingCapacityTemperatureDifferenceModificationFactorCurve(); |
| 457 | } | ||
| 458 | |||
| 459 | 11 | bool CoilCoolingFourPipeBeam::setBeamCoolingCapacityTemperatureDifferenceModificationFactorCurve(const Curve& curve) { | |
| 460 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->setBeamCoolingCapacityTemperatureDifferenceModificationFactorCurve(curve); |
| 461 | } | ||
| 462 | |||
| 463 | // Beam Cooling Capacity Air Flow Modification Factor Curve | ||
| 464 | |||
| 465 | 4 | Curve CoilCoolingFourPipeBeam::beamCoolingCapacityAirFlowModificationFactorCurve() const { | |
| 466 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->beamCoolingCapacityAirFlowModificationFactorCurve(); |
| 467 | } | ||
| 468 | |||
| 469 | 11 | bool CoilCoolingFourPipeBeam::setBeamCoolingCapacityAirFlowModificationFactorCurve(const Curve& curve) { | |
| 470 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->setBeamCoolingCapacityAirFlowModificationFactorCurve(curve); |
| 471 | } | ||
| 472 | |||
| 473 | // Beam Cooling Capacity Chilled Water Flow Modification Factor Curve | ||
| 474 | |||
| 475 | 4 | Curve CoilCoolingFourPipeBeam::beamCoolingCapacityChilledWaterFlowModificationFactorCurve() const { | |
| 476 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->beamCoolingCapacityChilledWaterFlowModificationFactorCurve(); |
| 477 | } | ||
| 478 | |||
| 479 | 11 | bool CoilCoolingFourPipeBeam::setBeamCoolingCapacityChilledWaterFlowModificationFactorCurve(const Curve& curve) { | |
| 480 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->setBeamCoolingCapacityChilledWaterFlowModificationFactorCurve(curve); |
| 481 | } | ||
| 482 | |||
| 483 | /* Convenience functions */ | ||
| 484 | |||
| 485 | ✗ | boost::optional<AirTerminalSingleDuctConstantVolumeFourPipeBeam> CoilCoolingFourPipeBeam::airTerminalSingleDuctConstantVolumeFourPipeBeam() const { | |
| 486 | ✗ | return getImpl<detail::CoilCoolingFourPipeBeam_Impl>()->airTerminalSingleDuctConstantVolumeFourPipeBeam(); | |
| 487 | } | ||
| 488 | |||
| 489 | /// @cond | ||
| 490 |
1/1✓ Branch 2 taken 24 times.
|
24 | CoilCoolingFourPipeBeam::CoilCoolingFourPipeBeam(std::shared_ptr<detail::CoilCoolingFourPipeBeam_Impl> impl) : StraightComponent(impl) {} |
| 491 | /// @endcond | ||
| 492 | |||
| 493 | } // namespace model | ||
| 494 | } // namespace openstudio | ||
| 495 |