src/model/AirflowNetworkHorizontalOpening.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 "AirflowNetworkHorizontalOpening.hpp" | ||
| 7 | #include "AirflowNetworkHorizontalOpening_Impl.hpp" | ||
| 8 | |||
| 9 | #include <utilities/idd/IddEnums.hxx> | ||
| 10 | #include <utilities/idd/OS_AirflowNetworkHorizontalOpening_FieldEnums.hxx> | ||
| 11 | |||
| 12 | #include "../utilities/units/Unit.hpp" | ||
| 13 | |||
| 14 | #include "../utilities/core/Assert.hpp" | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | namespace model { | ||
| 18 | |||
| 19 | namespace detail { | ||
| 20 | |||
| 21 | 3 | AirflowNetworkHorizontalOpening_Impl::AirflowNetworkHorizontalOpening_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 22 | 3 | : AirflowNetworkComponent_Impl(idfObject, model, keepHandle) { | |
| 23 |
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() == AirflowNetworkHorizontalOpening::iddObjectType()); |
| 24 | 3 | } | |
| 25 | |||
| 26 | ✗ | AirflowNetworkHorizontalOpening_Impl::AirflowNetworkHorizontalOpening_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 27 | ✗ | Model_Impl* model, bool keepHandle) | |
| 28 | ✗ | : AirflowNetworkComponent_Impl(other, model, keepHandle) { | |
| 29 | ✗ | OS_ASSERT(other.iddObject().type() == AirflowNetworkHorizontalOpening::iddObjectType()); | |
| 30 | ✗ | } | |
| 31 | |||
| 32 | 1 | AirflowNetworkHorizontalOpening_Impl::AirflowNetworkHorizontalOpening_Impl(const AirflowNetworkHorizontalOpening_Impl& other, Model_Impl* model, | |
| 33 | 1 | bool keepHandle) | |
| 34 | 1 | : AirflowNetworkComponent_Impl(other, model, keepHandle) {} | |
| 35 | |||
| 36 | ✗ | const std::vector<std::string>& AirflowNetworkHorizontalOpening_Impl::outputVariableNames() const { | |
| 37 | ✗ | static const std::vector<std::string> result; | |
| 38 | ✗ | return result; | |
| 39 | } | ||
| 40 | |||
| 41 | ✗ | IddObjectType AirflowNetworkHorizontalOpening_Impl::iddObjectType() const { | |
| 42 | ✗ | return AirflowNetworkHorizontalOpening::iddObjectType(); | |
| 43 | } | ||
| 44 | |||
| 45 | 3 | double AirflowNetworkHorizontalOpening_Impl::airMassFlowCoefficientWhenOpeningisClosed() const { | |
| 46 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_AirflowNetworkHorizontalOpeningFields::AirMassFlowCoefficientWhenOpeningisClosed, true); |
| 47 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 48 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 49 | } | ||
| 50 | |||
| 51 | 3 | double AirflowNetworkHorizontalOpening_Impl::airMassFlowExponentWhenOpeningisClosed() const { | |
| 52 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_AirflowNetworkHorizontalOpeningFields::AirMassFlowExponentWhenOpeningisClosed, true); |
| 53 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 54 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 55 | } | ||
| 56 | |||
| 57 | ✗ | bool AirflowNetworkHorizontalOpening_Impl::isAirMassFlowExponentWhenOpeningisClosedDefaulted() const { | |
| 58 | ✗ | return isEmpty(OS_AirflowNetworkHorizontalOpeningFields::AirMassFlowExponentWhenOpeningisClosed); | |
| 59 | } | ||
| 60 | |||
| 61 | 3 | double AirflowNetworkHorizontalOpening_Impl::slopingPlaneAngle() const { | |
| 62 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_AirflowNetworkHorizontalOpeningFields::SlopingPlaneAngle, true); |
| 63 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 64 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 65 | } | ||
| 66 | |||
| 67 | ✗ | bool AirflowNetworkHorizontalOpening_Impl::isSlopingPlaneAngleDefaulted() const { | |
| 68 | ✗ | return isEmpty(OS_AirflowNetworkHorizontalOpeningFields::SlopingPlaneAngle); | |
| 69 | } | ||
| 70 | |||
| 71 | 3 | double AirflowNetworkHorizontalOpening_Impl::dischargeCoefficient() const { | |
| 72 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_AirflowNetworkHorizontalOpeningFields::DischargeCoefficient, true); |
| 73 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 74 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 75 | } | ||
| 76 | |||
| 77 | 3 | bool AirflowNetworkHorizontalOpening_Impl::setAirMassFlowCoefficientWhenOpeningisClosed(double airMassFlowCoefficientWhenOpeningisClosed) { | |
| 78 | bool result = | ||
| 79 | 3 | setDouble(OS_AirflowNetworkHorizontalOpeningFields::AirMassFlowCoefficientWhenOpeningisClosed, airMassFlowCoefficientWhenOpeningisClosed); | |
| 80 | 3 | return result; | |
| 81 | } | ||
| 82 | |||
| 83 | 1 | bool AirflowNetworkHorizontalOpening_Impl::setAirMassFlowExponentWhenOpeningisClosed(double airMassFlowExponentWhenOpeningisClosed) { | |
| 84 | bool result = | ||
| 85 | 1 | setDouble(OS_AirflowNetworkHorizontalOpeningFields::AirMassFlowExponentWhenOpeningisClosed, airMassFlowExponentWhenOpeningisClosed); | |
| 86 | 1 | return result; | |
| 87 | } | ||
| 88 | |||
| 89 | ✗ | void AirflowNetworkHorizontalOpening_Impl::resetAirMassFlowExponentWhenOpeningisClosed() { | |
| 90 | ✗ | bool result = setString(OS_AirflowNetworkHorizontalOpeningFields::AirMassFlowExponentWhenOpeningisClosed, ""); | |
| 91 | ✗ | OS_ASSERT(result); | |
| 92 | ✗ | } | |
| 93 | |||
| 94 | 1 | bool AirflowNetworkHorizontalOpening_Impl::setSlopingPlaneAngle(double slopingPlaneAngle) { | |
| 95 | 1 | bool result = setDouble(OS_AirflowNetworkHorizontalOpeningFields::SlopingPlaneAngle, slopingPlaneAngle); | |
| 96 | 1 | return result; | |
| 97 | } | ||
| 98 | |||
| 99 | ✗ | void AirflowNetworkHorizontalOpening_Impl::resetSlopingPlaneAngle() { | |
| 100 | ✗ | bool result = setString(OS_AirflowNetworkHorizontalOpeningFields::SlopingPlaneAngle, ""); | |
| 101 | ✗ | OS_ASSERT(result); | |
| 102 | ✗ | } | |
| 103 | |||
| 104 | 3 | bool AirflowNetworkHorizontalOpening_Impl::setDischargeCoefficient(double dischargeCoefficient) { | |
| 105 | 3 | bool result = setDouble(OS_AirflowNetworkHorizontalOpeningFields::DischargeCoefficient, dischargeCoefficient); | |
| 106 | 3 | return result; | |
| 107 | } | ||
| 108 | |||
| 109 | } // namespace detail | ||
| 110 | |||
| 111 | 2 | AirflowNetworkHorizontalOpening::AirflowNetworkHorizontalOpening(const Model& model, double massFlowCoefficientWhenOpeningisClosed, | |
| 112 | 2 | double dischargeCoefficient) | |
| 113 | 2 | : AirflowNetworkComponent(AirflowNetworkHorizontalOpening::iddObjectType(), model) { | |
| 114 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 5 not taken.
|
2 | OS_ASSERT(getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()); |
| 115 | |||
| 116 |
1/1✓ Branch 1 taken 2 times.
|
2 | bool ok = setAirMassFlowCoefficientWhenOpeningisClosed(massFlowCoefficientWhenOpeningisClosed); |
| 117 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 118 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = setDischargeCoefficient(dischargeCoefficient); |
| 119 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 120 | 2 | } | |
| 121 | |||
| 122 | 1 | AirflowNetworkHorizontalOpening::AirflowNetworkHorizontalOpening(const Model& model, double massFlowCoefficientWhenOpeningisClosed, | |
| 123 | double massFlowExponentWhenOpeningisClosed, double slopingPlaneAngle, | ||
| 124 | 1 | double dischargeCoefficient) | |
| 125 | 1 | : AirflowNetworkComponent(AirflowNetworkHorizontalOpening::iddObjectType(), model) { | |
| 126 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
|
1 | OS_ASSERT(getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()); |
| 127 | |||
| 128 |
1/1✓ Branch 1 taken 1 time.
|
1 | bool ok = setAirMassFlowCoefficientWhenOpeningisClosed(massFlowCoefficientWhenOpeningisClosed); |
| 129 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
|
1 | OS_ASSERT(ok); |
| 130 |
1/1✓ Branch 1 taken 1 time.
|
1 | ok = setAirMassFlowExponentWhenOpeningisClosed(massFlowExponentWhenOpeningisClosed); |
| 131 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
|
1 | OS_ASSERT(ok); |
| 132 |
1/1✓ Branch 1 taken 1 time.
|
1 | ok = setSlopingPlaneAngle(slopingPlaneAngle); |
| 133 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
|
1 | OS_ASSERT(ok); |
| 134 |
1/1✓ Branch 1 taken 1 time.
|
1 | ok = setDischargeCoefficient(dischargeCoefficient); |
| 135 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
|
1 | OS_ASSERT(ok); |
| 136 | 1 | } | |
| 137 | |||
| 138 | 8637 | IddObjectType AirflowNetworkHorizontalOpening::iddObjectType() { | |
| 139 |
1/1✓ Branch 1 taken 8637 times.
|
8637 | return {IddObjectType::OS_AirflowNetworkHorizontalOpening}; |
| 140 | } | ||
| 141 | |||
| 142 | 3 | double AirflowNetworkHorizontalOpening::airMassFlowCoefficientWhenOpeningisClosed() const { | |
| 143 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->airMassFlowCoefficientWhenOpeningisClosed(); |
| 144 | } | ||
| 145 | |||
| 146 | 3 | double AirflowNetworkHorizontalOpening::airMassFlowExponentWhenOpeningisClosed() const { | |
| 147 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->airMassFlowExponentWhenOpeningisClosed(); |
| 148 | } | ||
| 149 | |||
| 150 | ✗ | bool AirflowNetworkHorizontalOpening::isAirMassFlowExponentWhenOpeningisClosedDefaulted() const { | |
| 151 | ✗ | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->isAirMassFlowExponentWhenOpeningisClosedDefaulted(); | |
| 152 | } | ||
| 153 | |||
| 154 | 3 | double AirflowNetworkHorizontalOpening::slopingPlaneAngle() const { | |
| 155 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->slopingPlaneAngle(); |
| 156 | } | ||
| 157 | |||
| 158 | ✗ | bool AirflowNetworkHorizontalOpening::isSlopingPlaneAngleDefaulted() const { | |
| 159 | ✗ | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->isSlopingPlaneAngleDefaulted(); | |
| 160 | } | ||
| 161 | |||
| 162 | 3 | double AirflowNetworkHorizontalOpening::dischargeCoefficient() const { | |
| 163 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->dischargeCoefficient(); |
| 164 | } | ||
| 165 | |||
| 166 | 3 | bool AirflowNetworkHorizontalOpening::setAirMassFlowCoefficientWhenOpeningisClosed(double airMassFlowCoefficientWhenOpeningisClosed) { | |
| 167 |
1/1✓ Branch 3 taken 3 times.
|
6 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->setAirMassFlowCoefficientWhenOpeningisClosed( |
| 168 | 6 | airMassFlowCoefficientWhenOpeningisClosed); | |
| 169 | } | ||
| 170 | |||
| 171 | 1 | bool AirflowNetworkHorizontalOpening::setAirMassFlowExponentWhenOpeningisClosed(double airMassFlowExponentWhenOpeningisClosed) { | |
| 172 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->setAirMassFlowExponentWhenOpeningisClosed(airMassFlowExponentWhenOpeningisClosed); |
| 173 | } | ||
| 174 | |||
| 175 | ✗ | void AirflowNetworkHorizontalOpening::resetAirMassFlowExponentWhenOpeningisClosed() { | |
| 176 | ✗ | getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->resetAirMassFlowExponentWhenOpeningisClosed(); | |
| 177 | ✗ | } | |
| 178 | |||
| 179 | 1 | bool AirflowNetworkHorizontalOpening::setSlopingPlaneAngle(double slopingPlaneAngle) { | |
| 180 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->setSlopingPlaneAngle(slopingPlaneAngle); |
| 181 | } | ||
| 182 | |||
| 183 | ✗ | void AirflowNetworkHorizontalOpening::resetSlopingPlaneAngle() { | |
| 184 | ✗ | getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->resetSlopingPlaneAngle(); | |
| 185 | ✗ | } | |
| 186 | |||
| 187 | 3 | bool AirflowNetworkHorizontalOpening::setDischargeCoefficient(double dischargeCoefficient) { | |
| 188 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::AirflowNetworkHorizontalOpening_Impl>()->setDischargeCoefficient(dischargeCoefficient); |
| 189 | } | ||
| 190 | |||
| 191 | /// @cond | ||
| 192 | 1 | AirflowNetworkHorizontalOpening::AirflowNetworkHorizontalOpening(std::shared_ptr<detail::AirflowNetworkHorizontalOpening_Impl> impl) | |
| 193 |
1/1✓ Branch 2 taken 1 time.
|
1 | : AirflowNetworkComponent(impl) {} |
| 194 | /// @endcond | ||
| 195 | |||
| 196 | } // namespace model | ||
| 197 | } // namespace openstudio | ||
| 198 |