src/model/AirflowNetworkEquivalentDuct.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 "AirflowNetworkEquivalentDuct.hpp" | ||
| 7 | #include "AirflowNetworkEquivalentDuct_Impl.hpp" | ||
| 8 | |||
| 9 | #include "StraightComponent.hpp" | ||
| 10 | #include "StraightComponent_Impl.hpp" | ||
| 11 | |||
| 12 | #include <utilities/idd/IddFactory.hxx> | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | #include <utilities/idd/OS_AirflowNetworkEquivalentDuct_FieldEnums.hxx> | ||
| 15 | |||
| 16 | #include "../utilities/units/Unit.hpp" | ||
| 17 | |||
| 18 | #include "../utilities/core/Assert.hpp" | ||
| 19 | |||
| 20 | namespace openstudio { | ||
| 21 | namespace model { | ||
| 22 | |||
| 23 | namespace detail { | ||
| 24 | |||
| 25 | 3 | AirflowNetworkEquivalentDuct_Impl::AirflowNetworkEquivalentDuct_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 26 | 3 | : AirflowNetworkComponent_Impl(idfObject, model, keepHandle) { | |
| 27 |
4/6✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 13 not taken.
|
3 | OS_ASSERT(idfObject.iddObject().type() == AirflowNetworkEquivalentDuct::iddObjectType()); |
| 28 | 3 | } | |
| 29 | |||
| 30 | ✗ | AirflowNetworkEquivalentDuct_Impl::AirflowNetworkEquivalentDuct_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 31 | ✗ | bool keepHandle) | |
| 32 | ✗ | : AirflowNetworkComponent_Impl(other, model, keepHandle) { | |
| 33 | ✗ | OS_ASSERT(other.iddObject().type() == AirflowNetworkEquivalentDuct::iddObjectType()); | |
| 34 | ✗ | } | |
| 35 | |||
| 36 | 2 | AirflowNetworkEquivalentDuct_Impl::AirflowNetworkEquivalentDuct_Impl(const AirflowNetworkEquivalentDuct_Impl& other, Model_Impl* model, | |
| 37 | 2 | bool keepHandle) | |
| 38 | 2 | : AirflowNetworkComponent_Impl(other, model, keepHandle) {} | |
| 39 | |||
| 40 | ✗ | const std::vector<std::string>& AirflowNetworkEquivalentDuct_Impl::outputVariableNames() const { | |
| 41 | ✗ | static const std::vector<std::string> result; | |
| 42 | ✗ | return result; | |
| 43 | } | ||
| 44 | |||
| 45 | ✗ | IddObjectType AirflowNetworkEquivalentDuct_Impl::iddObjectType() const { | |
| 46 | ✗ | return AirflowNetworkEquivalentDuct::iddObjectType(); | |
| 47 | } | ||
| 48 | |||
| 49 | 12 | boost::optional<StraightComponent> AirflowNetworkEquivalentDuct_Impl::straightComponent() const { | |
| 50 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | return getObject<ModelObject>().getModelObjectTarget<StraightComponent>(OS_AirflowNetworkEquivalentDuctFields::ComponentName); |
| 51 | } | ||
| 52 | |||
| 53 | 6 | boost::optional<std::string> AirflowNetworkEquivalentDuct_Impl::coilObjectType() const { | |
| 54 |
1/1✓ Branch 1 taken 6 times.
|
6 | auto optsc = straightComponent(); |
| 55 |
1/2✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
|
6 | if (optsc) { |
| 56 |
5/23✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
|
6 | switch (optsc->iddObjectType().value()) { |
| 57 | 3 | case IddObjectType::OS_Coil_Cooling_DX_SingleSpeed: | |
| 58 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | return std::string("Coil:Cooling:DX:SingleSpeed"); |
| 59 | ✗ | case IddObjectType::OS_Coil_Cooling_DX_TwoSpeed: | |
| 60 | ✗ | return std::string("Coil:Cooling:DX:TwoSpeed"); | |
| 61 | 3 | case IddObjectType::OS_Coil_Heating_Gas: | |
| 62 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | return std::string("Coil:Heating:Fuel"); |
| 63 | ✗ | case IddObjectType::OS_Coil_Heating_Electric: | |
| 64 | ✗ | return std::string("Coil:Heating:Electric"); | |
| 65 | ✗ | case IddObjectType::OS_Coil_Heating_DX_SingleSpeed: | |
| 66 | ✗ | return std::string("Coil:Heating:DX:SingleSpeed"); | |
| 67 | ✗ | case IddObjectType::OS_Coil_Cooling_Water: | |
| 68 | ✗ | return std::string("Coil:Cooling:Water"); | |
| 69 | ✗ | case IddObjectType::OS_Coil_Heating_Water: | |
| 70 | ✗ | return std::string("Coil:Heating:Water"); | |
| 71 | //case IddObjectType::Coil_Cooling_Water_DetailedGeometry: | ||
| 72 | // return std::string("Coil:Cooling:Water:DetailedGeometry"); | ||
| 73 | ✗ | case IddObjectType::OS_Coil_Cooling_DX_TwoStageWithHumidityControlMode: | |
| 74 | ✗ | return std::string("Coil:Cooling:DX:TwoStageWithHumidityControlMode"); | |
| 75 | ✗ | case IddObjectType::OS_Coil_Cooling_DX_MultiSpeed: | |
| 76 | ✗ | return std::string("Coil:Cooling:DX:MultiSpeed"); | |
| 77 | ✗ | case IddObjectType::OS_Coil_Heating_DX_MultiSpeed: | |
| 78 | ✗ | return std::string("Coil:Heating:DX:MultiSpeed"); | |
| 79 | ✗ | case IddObjectType::OS_Coil_Cooling_DX_VariableSpeed: | |
| 80 | ✗ | return std::string("Coil:Cooling:DX:VariableSpeed"); | |
| 81 | ✗ | case IddObjectType::OS_Coil_Heating_DX_VariableSpeed: | |
| 82 | ✗ | return std::string("Coil:Heating:DX:VariableSpeed"); | |
| 83 | ✗ | case IddObjectType::OS_Coil_Heating_Desuperheater: | |
| 84 | ✗ | return std::string("Coil:Heating:Desuperheater"); | |
| 85 | ✗ | case IddObjectType::OS_Coil_Cooling_DX: | |
| 86 | ✗ | return std::string("Coil:Cooling:DX"); | |
| 87 | ✗ | case IddObjectType::OS_Coil_Cooling_DX_SingleSpeed_ThermalStorage: | |
| 88 | ✗ | return std::string("Coil:Cooling:DX:SingleSpeed:ThermalStorage"); | |
| 89 | ✗ | case IddObjectType::OS_Coil_Cooling_WaterToAirHeatPump_EquationFit: | |
| 90 | ✗ | return std::string("Coil:Cooling:WaterToAirHeatPump:EquationFit"); | |
| 91 | ✗ | case IddObjectType::OS_Coil_Heating_WaterToAirHeatPump_EquationFit: | |
| 92 | ✗ | return std::string("Coil:Heating:WaterToAirHeatPump:EquationFit"); | |
| 93 | ✗ | case IddObjectType::OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFit: | |
| 94 | ✗ | return std::string("Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit"); | |
| 95 | ✗ | case IddObjectType::OS_Coil_Heating_WaterToAirHeatPump_VariableSpeedEquationFit: | |
| 96 | ✗ | return std::string("Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit"); | |
| 97 | ✗ | default: | |
| 98 | ✗ | return boost::none; | |
| 99 | } | ||
| 100 | } | ||
| 101 | ✗ | return boost::none; | |
| 102 | 6 | } | |
| 103 | |||
| 104 | ✗ | boost::optional<std::string> AirflowNetworkEquivalentDuct_Impl::heatExchangerObjectType() const { | |
| 105 | ✗ | auto optsc = straightComponent(); | |
| 106 | ✗ | if (optsc) { | |
| 107 | ✗ | switch (optsc->iddObjectType().value()) { | |
| 108 | //case IddObjectType::HeatExchanger_AirToAir_FlatPlate: | ||
| 109 | // return std::string("HeatExchanger:AirToAir:FlatPlate"); | ||
| 110 | ✗ | case IddObjectType::OS_HeatExchanger_AirToAir_SensibleAndLatent: | |
| 111 | ✗ | return std::string("HeatExchanger:AirToAir:SensibleAndLatent"); | |
| 112 | //case IddObjectType::HeatExchanger_Desiccant_BalancedFlow: | ||
| 113 | // return std::string("HeatExchanger:Desiccant:BalancedFlow"); | ||
| 114 | ✗ | default: | |
| 115 | ✗ | return boost::none; | |
| 116 | } | ||
| 117 | } | ||
| 118 | ✗ | return boost::none; | |
| 119 | ✗ | } | |
| 120 | |||
| 121 | ✗ | boost::optional<std::string> AirflowNetworkEquivalentDuct_Impl::terminalUnitObjectType() const { | |
| 122 | ✗ | auto optsc = straightComponent(); | |
| 123 | ✗ | if (optsc) { | |
| 124 | ✗ | switch (optsc->iddObjectType().value()) { | |
| 125 | ✗ | case IddObjectType::OS_AirTerminal_SingleDuct_ConstantVolume_Reheat: | |
| 126 | ✗ | return std::string("AirTerminal:SingleDuct:ConstantVolume:Reheat"); | |
| 127 | ✗ | case IddObjectType::OS_AirTerminal_SingleDuct_VAV_Reheat: | |
| 128 | ✗ | return std::string("AirTerminal:SingleDuct:VAV:Reheat"); | |
| 129 | ✗ | default: | |
| 130 | ✗ | return boost::none; | |
| 131 | } | ||
| 132 | } | ||
| 133 | ✗ | return boost::none; | |
| 134 | ✗ | } | |
| 135 | |||
| 136 | 5 | boost::optional<ModelObject> AirflowNetworkEquivalentDuct_Impl::componentModelObject() const { | |
| 137 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | return getObject<ModelObject>().getModelObjectTarget<ModelObject>(OS_AirflowNetworkEquivalentDuctFields::ComponentName); |
| 138 | } | ||
| 139 | |||
| 140 | 2 | double AirflowNetworkEquivalentDuct_Impl::airPathLength() const { | |
| 141 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<double> value = getDouble(OS_AirflowNetworkEquivalentDuctFields::AirPathLength, true); |
| 142 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 143 |
1/1✓ Branch 1 taken 2 times.
|
4 | return value.get(); |
| 144 | } | ||
| 145 | |||
| 146 | 2 | double AirflowNetworkEquivalentDuct_Impl::airPathHydraulicDiameter() const { | |
| 147 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<double> value = getDouble(OS_AirflowNetworkEquivalentDuctFields::AirPathHydraulicDiameter, true); |
| 148 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 149 |
1/1✓ Branch 1 taken 2 times.
|
4 | return value.get(); |
| 150 | } | ||
| 151 | |||
| 152 | 3 | bool AirflowNetworkEquivalentDuct_Impl::setAirPathLength(double airPathLength) { | |
| 153 | 3 | bool result = setDouble(OS_AirflowNetworkEquivalentDuctFields::AirPathLength, airPathLength); | |
| 154 | 3 | return result; | |
| 155 | } | ||
| 156 | |||
| 157 | 3 | bool AirflowNetworkEquivalentDuct_Impl::setAirPathHydraulicDiameter(double airPathHydraulicDiameter) { | |
| 158 | 3 | bool result = setDouble(OS_AirflowNetworkEquivalentDuctFields::AirPathHydraulicDiameter, airPathHydraulicDiameter); | |
| 159 | 3 | return result; | |
| 160 | } | ||
| 161 | |||
| 162 | ✗ | void AirflowNetworkEquivalentDuct_Impl::resetComponent() { | |
| 163 | ✗ | bool result = setString(OS_AirflowNetworkEquivalentDuctFields::ComponentName, ""); | |
| 164 | ✗ | OS_ASSERT(result); | |
| 165 | ✗ | } | |
| 166 | |||
| 167 | } // namespace detail | ||
| 168 | |||
| 169 | 3 | AirflowNetworkEquivalentDuct::AirflowNetworkEquivalentDuct(const Model& model, double length, double diameter, const Handle& handle) | |
| 170 | 3 | : AirflowNetworkComponent(AirflowNetworkEquivalentDuct::iddObjectType(), model) { | |
| 171 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 3 times.
✗ Branch 5 not taken.
|
3 | OS_ASSERT(getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()); |
| 172 |
1/1✓ Branch 3 taken 3 times.
|
3 | bool ok = getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->setPointer(OS_AirflowNetworkEquivalentDuctFields::ComponentName, handle); |
| 173 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
|
3 | OS_ASSERT(ok); |
| 174 |
1/1✓ Branch 1 taken 3 times.
|
3 | ok = setAirPathLength(length); |
| 175 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
|
3 | OS_ASSERT(ok); |
| 176 |
1/1✓ Branch 1 taken 3 times.
|
3 | ok = setAirPathHydraulicDiameter(diameter); |
| 177 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
|
3 | OS_ASSERT(ok); |
| 178 | 3 | } | |
| 179 | |||
| 180 | 8934 | IddObjectType AirflowNetworkEquivalentDuct::iddObjectType() { | |
| 181 |
1/1✓ Branch 1 taken 8934 times.
|
8934 | return {IddObjectType::OS_AirflowNetworkEquivalentDuct}; |
| 182 | } | ||
| 183 | |||
| 184 | 6 | boost::optional<StraightComponent> AirflowNetworkEquivalentDuct::straightComponent() const { | |
| 185 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->straightComponent(); |
| 186 | } | ||
| 187 | |||
| 188 | 6 | boost::optional<std::string> AirflowNetworkEquivalentDuct::coilObjectType() const { | |
| 189 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->coilObjectType(); |
| 190 | } | ||
| 191 | |||
| 192 | ✗ | boost::optional<std::string> AirflowNetworkEquivalentDuct::heatExchangerObjectType() const { | |
| 193 | ✗ | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->heatExchangerObjectType(); | |
| 194 | } | ||
| 195 | |||
| 196 | ✗ | boost::optional<std::string> AirflowNetworkEquivalentDuct::terminalUnitObjectType() const { | |
| 197 | ✗ | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->terminalUnitObjectType(); | |
| 198 | } | ||
| 199 | |||
| 200 | 2 | double AirflowNetworkEquivalentDuct::airPathLength() const { | |
| 201 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->airPathLength(); |
| 202 | } | ||
| 203 | |||
| 204 | 2 | double AirflowNetworkEquivalentDuct::airPathHydraulicDiameter() const { | |
| 205 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->airPathHydraulicDiameter(); |
| 206 | } | ||
| 207 | |||
| 208 | 3 | bool AirflowNetworkEquivalentDuct::setAirPathLength(double airPathLength) { | |
| 209 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->setAirPathLength(airPathLength); |
| 210 | } | ||
| 211 | |||
| 212 | 3 | bool AirflowNetworkEquivalentDuct::setAirPathHydraulicDiameter(double airPathHydraulicDiameter) { | |
| 213 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->setAirPathHydraulicDiameter(airPathHydraulicDiameter); |
| 214 | } | ||
| 215 | |||
| 216 | ✗ | void AirflowNetworkEquivalentDuct::resetComponent() { | |
| 217 | ✗ | getImpl<detail::AirflowNetworkEquivalentDuct_Impl>()->resetComponent(); | |
| 218 | ✗ | } | |
| 219 | |||
| 220 | /// @cond | ||
| 221 | 5 | AirflowNetworkEquivalentDuct::AirflowNetworkEquivalentDuct(std::shared_ptr<detail::AirflowNetworkEquivalentDuct_Impl> impl) | |
| 222 |
1/1✓ Branch 2 taken 5 times.
|
5 | : AirflowNetworkComponent(impl) {} |
| 223 | /// @endcond | ||
| 224 | |||
| 225 | } // namespace model | ||
| 226 | } // namespace openstudio | ||
| 227 |