src/model/SpaceInfiltrationDesignFlowRate.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 "SpaceInfiltrationDesignFlowRate.hpp" | ||
| 7 | #include "SpaceInfiltrationDesignFlowRate_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Schedule.hpp" | ||
| 10 | #include "Schedule_Impl.hpp" | ||
| 11 | #include "Space.hpp" | ||
| 12 | #include "Space_Impl.hpp" | ||
| 13 | #include "SpaceType.hpp" | ||
| 14 | #include "SpaceType_Impl.hpp" | ||
| 15 | #include "DefaultScheduleSet.hpp" | ||
| 16 | #include "DefaultScheduleSet_Impl.hpp" | ||
| 17 | #include "LifeCycleCost.hpp" | ||
| 18 | |||
| 19 | #include <utilities/idd/IddFactory.hxx> | ||
| 20 | |||
| 21 | #include <utilities/idd/OS_SpaceInfiltration_DesignFlowRate_FieldEnums.hxx> | ||
| 22 | #include <utilities/idd/IddEnums.hxx> | ||
| 23 | |||
| 24 | #include "../utilities/units/QuantityConverter.hpp" | ||
| 25 | |||
| 26 | #include "../utilities/core/Assert.hpp" | ||
| 27 | |||
| 28 | namespace openstudio { | ||
| 29 | namespace model { | ||
| 30 | |||
| 31 | namespace detail { | ||
| 32 | |||
| 33 | 727 | SpaceInfiltrationDesignFlowRate_Impl::SpaceInfiltrationDesignFlowRate_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 34 | 727 | : SpaceLoad_Impl(idfObject, model, keepHandle) { | |
| 35 |
4/6✓ Branch 1 taken 727 times.
✓ Branch 4 taken 727 times.
✓ Branch 7 taken 727 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 727 times.
✗ Branch 13 not taken.
|
727 | OS_ASSERT(idfObject.iddObject().type() == SpaceInfiltrationDesignFlowRate::iddObjectType()); |
| 36 | 727 | } | |
| 37 | |||
| 38 | 654 | SpaceInfiltrationDesignFlowRate_Impl::SpaceInfiltrationDesignFlowRate_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 39 | 654 | Model_Impl* model, bool keepHandle) | |
| 40 | 654 | : SpaceLoad_Impl(other, model, keepHandle) { | |
| 41 |
4/6✓ Branch 1 taken 654 times.
✓ Branch 4 taken 654 times.
✓ Branch 7 taken 654 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 654 times.
✗ Branch 13 not taken.
|
654 | OS_ASSERT(other.iddObject().type() == SpaceInfiltrationDesignFlowRate::iddObjectType()); |
| 42 | 654 | } | |
| 43 | |||
| 44 | 257 | SpaceInfiltrationDesignFlowRate_Impl::SpaceInfiltrationDesignFlowRate_Impl(const SpaceInfiltrationDesignFlowRate_Impl& other, Model_Impl* model, | |
| 45 | 257 | bool keepHandle) | |
| 46 | 257 | : SpaceLoad_Impl(other, model, keepHandle) {} | |
| 47 | |||
| 48 | ✗ | const std::vector<std::string>& SpaceInfiltrationDesignFlowRate_Impl::outputVariableNames() const { | |
| 49 | ✗ | static const std::vector<std::string> result; | |
| 50 | ✗ | return result; | |
| 51 | } | ||
| 52 | |||
| 53 | ✗ | IddObjectType SpaceInfiltrationDesignFlowRate_Impl::iddObjectType() const { | |
| 54 | ✗ | return SpaceInfiltrationDesignFlowRate::iddObjectType(); | |
| 55 | } | ||
| 56 | |||
| 57 | ✗ | std::vector<ScheduleTypeKey> SpaceInfiltrationDesignFlowRate_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 58 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 59 | ✗ | UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 60 | ✗ | UnsignedVector::const_iterator b(fieldIndices.begin()); | |
| 61 | ✗ | UnsignedVector::const_iterator e(fieldIndices.end()); | |
| 62 | ✗ | if (std::find(b, e, OS_SpaceInfiltration_DesignFlowRateFields::ScheduleName) != e) { | |
| 63 | ✗ | result.push_back(ScheduleTypeKey("SpaceInfiltrationDesignFlowRate", "Infiltration")); | |
| 64 | } | ||
| 65 | ✗ | return result; | |
| 66 | ✗ | } | |
| 67 | |||
| 68 | 16 | bool SpaceInfiltrationDesignFlowRate_Impl::hardSize() { | |
| 69 |
1/1✓ Branch 1 taken 16 times.
|
16 | boost::optional<Space> space = this->space(); |
| 70 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 16 times.
|
16 | if (!space) { |
| 71 | ✗ | return false; | |
| 72 | } | ||
| 73 | |||
| 74 |
1/1✓ Branch 1 taken 16 times.
|
16 | boost::optional<double> designFlowRate = this->designFlowRate(); |
| 75 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 7 times.
|
16 | if (designFlowRate) { |
| 76 | 9 | return true; | |
| 77 | } | ||
| 78 | |||
| 79 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> flowperSpaceFloorArea = this->flowperSpaceFloorArea(); |
| 80 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 5 times.
|
7 | if (flowperSpaceFloorArea) { |
| 81 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | double floorArea = space->floorArea(); |
| 82 | |||
| 83 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | return this->setDesignFlowRate(*flowperSpaceFloorArea * floorArea); |
| 84 | } | ||
| 85 | |||
| 86 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<double> flowperExteriorSurfaceArea = this->flowperExteriorSurfaceArea(); |
| 87 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 4 times.
|
5 | if (flowperExteriorSurfaceArea) { |
| 88 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | double exteriorArea = space->exteriorArea(); |
| 89 | |||
| 90 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | return this->setDesignFlowRate(*flowperExteriorSurfaceArea * exteriorArea); |
| 91 | } | ||
| 92 | |||
| 93 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> flowperExteriorWallArea = this->flowperExteriorWallArea(); |
| 94 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | if (flowperExteriorWallArea) { |
| 95 | ✗ | double exteriorWallArea = space->exteriorWallArea(); | |
| 96 | |||
| 97 | ✗ | return this->setDesignFlowRate(*flowperExteriorWallArea * exteriorWallArea); | |
| 98 | } | ||
| 99 | |||
| 100 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> airChangesperHour = this->airChangesperHour(); |
| 101 |
1/2✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
|
4 | if (airChangesperHour) { |
| 102 |
5/5✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
|
4 | return this->setDesignFlowRate(*airChangesperHour * space->volume() / 3600.0); |
| 103 | } | ||
| 104 | |||
| 105 | ✗ | return false; | |
| 106 | 16 | } | |
| 107 | |||
| 108 | 20 | bool SpaceInfiltrationDesignFlowRate_Impl::hardApplySchedules() { | |
| 109 | 20 | bool result = false; | |
| 110 |
1/1✓ Branch 1 taken 20 times.
|
20 | boost::optional<Schedule> schedule = this->schedule(); |
| 111 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
|
20 | if (schedule) { |
| 112 | ✗ | result = this->setSchedule(*schedule); | |
| 113 | } | ||
| 114 | 20 | return result; | |
| 115 | 20 | } | |
| 116 | |||
| 117 | ✗ | bool SpaceInfiltrationDesignFlowRate_Impl::isAbsolute() const { | |
| 118 | ✗ | if (designFlowRate()) { | |
| 119 | ✗ | return true; | |
| 120 | } | ||
| 121 | ✗ | return false; | |
| 122 | } | ||
| 123 | |||
| 124 | 572 | std::string SpaceInfiltrationDesignFlowRate_Impl::designFlowRateCalculationMethod() const { | |
| 125 |
1/1✓ Branch 1 taken 572 times.
|
572 | boost::optional<std::string> value = getString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRateCalculationMethod, true); |
| 126 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 572 times.
✗ Branch 4 not taken.
|
572 | OS_ASSERT(value); |
| 127 |
2/2✓ Branch 1 taken 572 times.
✓ Branch 4 taken 572 times.
|
1144 | return value.get(); |
| 128 | 572 | } | |
| 129 | |||
| 130 | 100 | boost::optional<double> SpaceInfiltrationDesignFlowRate_Impl::designFlowRate() const { | |
| 131 | 100 | boost::optional<double> result; | |
| 132 |
5/5✓ Branch 1 taken 100 times.
✓ Branch 4 taken 100 times.
✓ Branch 7 taken 100 times.
✓ Branch 11 taken 26 times.
✓ Branch 12 taken 74 times.
|
300 | if (istringEqual("Flow/Space", this->designFlowRateCalculationMethod())) { |
| 133 |
1/1✓ Branch 1 taken 26 times.
|
26 | result = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRate, true); |
| 134 | } | ||
| 135 | 100 | return result; | |
| 136 | } | ||
| 137 | |||
| 138 | 87 | boost::optional<double> SpaceInfiltrationDesignFlowRate_Impl::flowperSpaceFloorArea() const { | |
| 139 | 87 | boost::optional<double> result; | |
| 140 |
5/5✓ Branch 1 taken 87 times.
✓ Branch 4 taken 87 times.
✓ Branch 7 taken 87 times.
✓ Branch 11 taken 8 times.
✓ Branch 12 taken 79 times.
|
261 | if (istringEqual("Flow/Area", this->designFlowRateCalculationMethod())) { |
| 141 |
1/1✓ Branch 1 taken 8 times.
|
8 | result = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperSpaceFloorArea, true); |
| 142 | } | ||
| 143 | 87 | return result; | |
| 144 | } | ||
| 145 | |||
| 146 | 84 | boost::optional<double> SpaceInfiltrationDesignFlowRate_Impl::flowperExteriorSurfaceArea() const { | |
| 147 | 84 | boost::optional<double> result; | |
| 148 |
5/5✓ Branch 1 taken 84 times.
✓ Branch 4 taken 84 times.
✓ Branch 7 taken 84 times.
✓ Branch 11 taken 61 times.
✓ Branch 12 taken 23 times.
|
252 | if (istringEqual("Flow/ExteriorArea", this->designFlowRateCalculationMethod())) { |
| 149 |
1/1✓ Branch 1 taken 61 times.
|
61 | result = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, true); |
| 150 | } | ||
| 151 | 84 | return result; | |
| 152 | } | ||
| 153 | |||
| 154 | 91 | boost::optional<double> SpaceInfiltrationDesignFlowRate_Impl::flowperExteriorWallArea() const { | |
| 155 | 91 | boost::optional<double> result; | |
| 156 |
5/5✓ Branch 1 taken 91 times.
✓ Branch 4 taken 91 times.
✓ Branch 7 taken 91 times.
✓ Branch 11 taken 13 times.
✓ Branch 12 taken 78 times.
|
273 | if (istringEqual("Flow/ExteriorWallArea", this->designFlowRateCalculationMethod())) { |
| 157 |
1/1✓ Branch 1 taken 13 times.
|
13 | result = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, true); |
| 158 | } | ||
| 159 | 91 | return result; | |
| 160 | } | ||
| 161 | |||
| 162 | 106 | boost::optional<double> SpaceInfiltrationDesignFlowRate_Impl::airChangesperHour() const { | |
| 163 | 106 | boost::optional<double> result; | |
| 164 |
5/5✓ Branch 1 taken 106 times.
✓ Branch 4 taken 106 times.
✓ Branch 7 taken 106 times.
✓ Branch 11 taken 36 times.
✓ Branch 12 taken 70 times.
|
318 | if (istringEqual("AirChanges/Hour", this->designFlowRateCalculationMethod())) { |
| 165 |
1/1✓ Branch 1 taken 36 times.
|
36 | result = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::AirChangesperHour, true); |
| 166 | } | ||
| 167 | 106 | return result; | |
| 168 | } | ||
| 169 | |||
| 170 | 17 | double SpaceInfiltrationDesignFlowRate_Impl::constantTermCoefficient() const { | |
| 171 |
1/1✓ Branch 1 taken 17 times.
|
17 | boost::optional<double> value = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::ConstantTermCoefficient, true); |
| 172 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
✗ Branch 4 not taken.
|
17 | OS_ASSERT(value); |
| 173 |
1/1✓ Branch 1 taken 17 times.
|
34 | return value.get(); |
| 174 | } | ||
| 175 | |||
| 176 | 70 | bool SpaceInfiltrationDesignFlowRate_Impl::isConstantTermCoefficientDefaulted() const { | |
| 177 | 70 | return isEmpty(OS_SpaceInfiltration_DesignFlowRateFields::ConstantTermCoefficient); | |
| 178 | } | ||
| 179 | |||
| 180 | 10 | double SpaceInfiltrationDesignFlowRate_Impl::temperatureTermCoefficient() const { | |
| 181 |
1/1✓ Branch 1 taken 10 times.
|
10 | boost::optional<double> value = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::TemperatureTermCoefficient, true); |
| 182 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 10 times.
✗ Branch 4 not taken.
|
10 | OS_ASSERT(value); |
| 183 |
1/1✓ Branch 1 taken 10 times.
|
20 | return value.get(); |
| 184 | } | ||
| 185 | |||
| 186 | 70 | bool SpaceInfiltrationDesignFlowRate_Impl::isTemperatureTermCoefficientDefaulted() const { | |
| 187 | 70 | return isEmpty(OS_SpaceInfiltration_DesignFlowRateFields::TemperatureTermCoefficient); | |
| 188 | } | ||
| 189 | |||
| 190 | 7 | double SpaceInfiltrationDesignFlowRate_Impl::velocityTermCoefficient() const { | |
| 191 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> value = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::VelocityTermCoefficient, true); |
| 192 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(value); |
| 193 |
1/1✓ Branch 1 taken 7 times.
|
14 | return value.get(); |
| 194 | } | ||
| 195 | |||
| 196 | 70 | bool SpaceInfiltrationDesignFlowRate_Impl::isVelocityTermCoefficientDefaulted() const { | |
| 197 | 70 | return isEmpty(OS_SpaceInfiltration_DesignFlowRateFields::VelocityTermCoefficient); | |
| 198 | } | ||
| 199 | |||
| 200 | 7 | double SpaceInfiltrationDesignFlowRate_Impl::velocitySquaredTermCoefficient() const { | |
| 201 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> value = getDouble(OS_SpaceInfiltration_DesignFlowRateFields::VelocitySquaredTermCoefficient, true); |
| 202 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(value); |
| 203 |
1/1✓ Branch 1 taken 7 times.
|
14 | return value.get(); |
| 204 | } | ||
| 205 | |||
| 206 | 70 | bool SpaceInfiltrationDesignFlowRate_Impl::isVelocitySquaredTermCoefficientDefaulted() const { | |
| 207 | 70 | return isEmpty(OS_SpaceInfiltration_DesignFlowRateFields::VelocitySquaredTermCoefficient); | |
| 208 | } | ||
| 209 | |||
| 210 | 87 | bool SpaceInfiltrationDesignFlowRate_Impl::setDesignFlowRate(boost::optional<double> designFlowRate) { | |
| 211 | 87 | bool result = true; | |
| 212 |
1/2✓ Branch 0 taken 87 times.
✗ Branch 1 not taken.
|
87 | if (designFlowRate) { |
| 213 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 87 times.
|
87 | if (*designFlowRate < 0) { |
| 214 | ✗ | result = false; | |
| 215 | } else { | ||
| 216 | // This one could return false for good reasons, if NaN of Infinity was passed | ||
| 217 | 87 | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRate, designFlowRate.get()); | |
| 218 |
1/2✓ Branch 0 taken 87 times.
✗ Branch 1 not taken.
|
87 | if (result) { |
| 219 |
2/2✓ Branch 1 taken 87 times.
✓ Branch 4 taken 87 times.
|
174 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRateCalculationMethod, "Flow/Space"); |
| 220 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 87 times.
|
87 | OS_ASSERT(result); |
| 221 |
2/2✓ Branch 1 taken 87 times.
✓ Branch 4 taken 87 times.
|
174 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::FlowperSpaceFloorArea, ""); |
| 222 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 87 times.
|
87 | OS_ASSERT(result); |
| 223 |
2/2✓ Branch 1 taken 87 times.
✓ Branch 4 taken 87 times.
|
174 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, ""); |
| 224 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 87 times.
|
87 | OS_ASSERT(result); |
| 225 |
2/2✓ Branch 1 taken 87 times.
✓ Branch 4 taken 87 times.
|
174 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::AirChangesperHour, ""); |
| 226 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 87 times.
|
87 | OS_ASSERT(result); |
| 227 | } | ||
| 228 | } | ||
| 229 | } else { | ||
| 230 | ✗ | if (istringEqual("Flow/Space", this->designFlowRateCalculationMethod())) { | |
| 231 | ✗ | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRate, 0.0); | |
| 232 | } | ||
| 233 | } | ||
| 234 | 87 | return result; | |
| 235 | } | ||
| 236 | |||
| 237 | 2 | bool SpaceInfiltrationDesignFlowRate_Impl::setFlowperSpaceFloorArea(boost::optional<double> flowperSpaceFloorArea) { | |
| 238 | 2 | bool result = true; | |
| 239 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (flowperSpaceFloorArea) { |
| 240 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
|
2 | if (*flowperSpaceFloorArea < 0) { |
| 241 | ✗ | result = false; | |
| 242 | } else { | ||
| 243 | // This one could return false for good reasons, if NaN of Infinity was passed | ||
| 244 | 2 | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperSpaceFloorArea, flowperSpaceFloorArea.get()); | |
| 245 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (result) { |
| 246 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRateCalculationMethod, "Flow/Area"); |
| 247 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 248 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRate, ""); |
| 249 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 250 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, ""); |
| 251 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 252 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::AirChangesperHour, ""); |
| 253 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 254 | } | ||
| 255 | } | ||
| 256 | } else { | ||
| 257 | ✗ | if (istringEqual("Flow/Area", this->designFlowRateCalculationMethod())) { | |
| 258 | ✗ | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperSpaceFloorArea, 0.0); | |
| 259 | } | ||
| 260 | } | ||
| 261 | 2 | return result; | |
| 262 | } | ||
| 263 | |||
| 264 | 28 | bool SpaceInfiltrationDesignFlowRate_Impl::setFlowperExteriorSurfaceArea(boost::optional<double> flowperExteriorSurfaceArea) { | |
| 265 | 28 | bool result = true; | |
| 266 |
1/2✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
|
28 | if (flowperExteriorSurfaceArea) { |
| 267 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
|
28 | if (*flowperExteriorSurfaceArea < 0) { |
| 268 | ✗ | result = false; | |
| 269 | } else { | ||
| 270 | // This one could return false for good reasons, if NaN of Infinity was passed | ||
| 271 | 28 | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, flowperExteriorSurfaceArea.get()); | |
| 272 |
1/2✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
|
28 | if (result) { |
| 273 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRateCalculationMethod, "Flow/ExteriorArea"); |
| 274 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 275 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRate, ""); |
| 276 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 277 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::FlowperSpaceFloorArea, ""); |
| 278 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 279 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::AirChangesperHour, ""); |
| 280 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 281 | } | ||
| 282 | } | ||
| 283 | } else { | ||
| 284 | ✗ | if (istringEqual("Flow/ExteriorArea", this->designFlowRateCalculationMethod())) { | |
| 285 | ✗ | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, 0.0); | |
| 286 | } | ||
| 287 | } | ||
| 288 | 28 | return result; | |
| 289 | } | ||
| 290 | |||
| 291 | 28 | bool SpaceInfiltrationDesignFlowRate_Impl::setFlowperExteriorWallArea(boost::optional<double> flowperExteriorWallArea) { | |
| 292 | 28 | bool result = true; | |
| 293 |
1/2✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
|
28 | if (flowperExteriorWallArea) { |
| 294 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
|
28 | if (*flowperExteriorWallArea < 0) { |
| 295 | ✗ | result = false; | |
| 296 | } else { | ||
| 297 | // This one could return false for good reasons, if NaN of Infinity was passed | ||
| 298 | 28 | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, flowperExteriorWallArea.get()); | |
| 299 |
1/2✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
|
28 | if (result) { |
| 300 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRateCalculationMethod, "Flow/ExteriorWallArea"); |
| 301 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 302 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRate, ""); |
| 303 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 304 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::FlowperSpaceFloorArea, ""); |
| 305 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 306 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
56 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::AirChangesperHour, ""); |
| 307 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
|
28 | OS_ASSERT(result); |
| 308 | } | ||
| 309 | } | ||
| 310 | } else { | ||
| 311 | ✗ | if (istringEqual("Flow/ExteriorWallArea", this->designFlowRateCalculationMethod())) { | |
| 312 | ✗ | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, 0.0); | |
| 313 | } | ||
| 314 | } | ||
| 315 | 28 | return result; | |
| 316 | } | ||
| 317 | |||
| 318 | 14 | bool SpaceInfiltrationDesignFlowRate_Impl::setAirChangesperHour(boost::optional<double> airChangesperHour) { | |
| 319 | 14 | bool result = true; | |
| 320 |
1/2✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
|
14 | if (airChangesperHour) { |
| 321 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 14 times.
|
14 | if (*airChangesperHour < 0) { |
| 322 | ✗ | result = false; | |
| 323 | } else { | ||
| 324 | // This one could return false for good reasons, if NaN of Infinity was passed | ||
| 325 | 14 | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::AirChangesperHour, airChangesperHour.get()); | |
| 326 |
1/2✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
|
14 | if (result) { |
| 327 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
|
28 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRateCalculationMethod, "AirChanges/Hour"); |
| 328 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
|
14 | OS_ASSERT(result); |
| 329 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
|
28 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRate, ""); |
| 330 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
|
14 | OS_ASSERT(result); |
| 331 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
|
28 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::FlowperSpaceFloorArea, ""); |
| 332 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
|
14 | OS_ASSERT(result); |
| 333 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
|
28 | result = setString(OS_SpaceInfiltration_DesignFlowRateFields::FlowperExteriorSurfaceArea, ""); |
| 334 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
|
14 | OS_ASSERT(result); |
| 335 | } | ||
| 336 | } | ||
| 337 | } else { | ||
| 338 | ✗ | if (istringEqual("AirChanges/Hour", this->designFlowRateCalculationMethod())) { | |
| 339 | ✗ | result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::AirChangesperHour, 0.0); | |
| 340 | } | ||
| 341 | } | ||
| 342 | 14 | return result; | |
| 343 | } | ||
| 344 | |||
| 345 | 52 | bool SpaceInfiltrationDesignFlowRate_Impl::setConstantTermCoefficient(double constantTermCoefficient) { | |
| 346 | 52 | bool result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::ConstantTermCoefficient, constantTermCoefficient); | |
| 347 | 52 | return result; | |
| 348 | } | ||
| 349 | |||
| 350 | ✗ | void SpaceInfiltrationDesignFlowRate_Impl::resetConstantTermCoefficient() { | |
| 351 | ✗ | bool result = setString(OS_SpaceInfiltration_DesignFlowRateFields::ConstantTermCoefficient, ""); | |
| 352 | ✗ | OS_ASSERT(result); | |
| 353 | ✗ | } | |
| 354 | |||
| 355 | 54 | bool SpaceInfiltrationDesignFlowRate_Impl::setTemperatureTermCoefficient(double temperatureTermCoefficient) { | |
| 356 | 54 | bool result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::TemperatureTermCoefficient, temperatureTermCoefficient); | |
| 357 | 54 | return result; | |
| 358 | } | ||
| 359 | |||
| 360 | ✗ | void SpaceInfiltrationDesignFlowRate_Impl::resetTemperatureTermCoefficient() { | |
| 361 | ✗ | bool result = setString(OS_SpaceInfiltration_DesignFlowRateFields::TemperatureTermCoefficient, ""); | |
| 362 | ✗ | OS_ASSERT(result); | |
| 363 | ✗ | } | |
| 364 | |||
| 365 | 52 | bool SpaceInfiltrationDesignFlowRate_Impl::setVelocityTermCoefficient(double velocityTermCoefficient) { | |
| 366 | 52 | bool result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::VelocityTermCoefficient, velocityTermCoefficient); | |
| 367 | 52 | return result; | |
| 368 | } | ||
| 369 | |||
| 370 | ✗ | void SpaceInfiltrationDesignFlowRate_Impl::resetVelocityTermCoefficient() { | |
| 371 | ✗ | bool result = setString(OS_SpaceInfiltration_DesignFlowRateFields::VelocityTermCoefficient, ""); | |
| 372 | ✗ | OS_ASSERT(result); | |
| 373 | ✗ | } | |
| 374 | |||
| 375 | 52 | bool SpaceInfiltrationDesignFlowRate_Impl::setVelocitySquaredTermCoefficient(double velocitySquaredTermCoefficient) { | |
| 376 | 52 | bool result = setDouble(OS_SpaceInfiltration_DesignFlowRateFields::VelocitySquaredTermCoefficient, velocitySquaredTermCoefficient); | |
| 377 | 52 | return result; | |
| 378 | } | ||
| 379 | |||
| 380 | ✗ | void SpaceInfiltrationDesignFlowRate_Impl::resetVelocitySquaredTermCoefficient() { | |
| 381 | ✗ | bool result = setString(OS_SpaceInfiltration_DesignFlowRateFields::VelocitySquaredTermCoefficient, ""); | |
| 382 | ✗ | OS_ASSERT(result); | |
| 383 | ✗ | } | |
| 384 | |||
| 385 | 73 | std::string SpaceInfiltrationDesignFlowRate_Impl::densityBasis() const { | |
| 386 |
1/1✓ Branch 1 taken 73 times.
|
73 | boost::optional<std::string> value = getString(OS_SpaceInfiltration_DesignFlowRateFields::DensityBasis, true); |
| 387 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 73 times.
✗ Branch 4 not taken.
|
73 | OS_ASSERT(value); |
| 388 |
2/2✓ Branch 1 taken 73 times.
✓ Branch 4 taken 73 times.
|
146 | return value.get(); |
| 389 | 73 | } | |
| 390 | |||
| 391 | 75 | bool SpaceInfiltrationDesignFlowRate_Impl::setDensityBasis(const std::string& densityBasis) { | |
| 392 | 75 | bool result = setString(OS_SpaceInfiltration_DesignFlowRateFields::DensityBasis, densityBasis); | |
| 393 | 75 | return result; | |
| 394 | } | ||
| 395 | |||
| 396 | 13 | double SpaceInfiltrationDesignFlowRate_Impl::getDesignFlowRate(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 397 | double airVolume) const { | ||
| 398 |
1/1✓ Branch 1 taken 13 times.
|
13 | std::string method = designFlowRateCalculationMethod(); |
| 399 | |||
| 400 |
2/3✓ Branch 1 taken 13 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 13 times.
|
13 | if (method == "Flow/Space") { |
| 401 | ✗ | return designFlowRate().get(); | |
| 402 |
2/3✓ Branch 1 taken 13 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 13 times.
|
13 | } else if (method == "Flow/Area") { |
| 403 | ✗ | return flowperSpaceFloorArea().get() * floorArea; | |
| 404 |
2/3✓ Branch 1 taken 13 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 13 times.
|
13 | } else if (method == "Flow/ExteriorArea") { |
| 405 | ✗ | return flowperExteriorSurfaceArea().get() * exteriorSurfaceArea; | |
| 406 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 7 times.
|
13 | } else if (method == "Flow/ExteriorWallArea") { |
| 407 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | return flowperExteriorWallArea().get() * exteriorWallArea; |
| 408 |
2/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
|
7 | } else if (method == "AirChanges/Hour") { |
| 409 |
6/6✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 7 times.
✓ Branch 13 taken 7 times.
✓ Branch 16 taken 7 times.
|
28 | return convert(airChangesperHour().get() * airVolume, "m^3/h", "m^3/s").get(); |
| 410 | } | ||
| 411 | |||
| 412 | ✗ | OS_ASSERT(false); | |
| 413 | ✗ | return 0.0; | |
| 414 | 13 | } | |
| 415 | |||
| 416 | 3 | double SpaceInfiltrationDesignFlowRate_Impl::getFlowPerSpaceFloorArea(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 417 | double airVolume) const { | ||
| 418 |
1/1✓ Branch 1 taken 3 times.
|
3 | std::string method = designFlowRateCalculationMethod(); |
| 419 | |||
| 420 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | if (method == "Flow/Space") { |
| 421 | ✗ | return designFlowRate().get() / floorArea; | |
| 422 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | } else if (method == "Flow/Area") { |
| 423 | ✗ | return flowperSpaceFloorArea().get(); | |
| 424 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | } else if (method == "Flow/ExteriorArea") { |
| 425 | ✗ | return flowperExteriorSurfaceArea().get() * (exteriorSurfaceArea / floorArea); | |
| 426 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
|
3 | } else if (method == "Flow/ExteriorWallArea") { |
| 427 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return flowperExteriorWallArea().get() * (exteriorWallArea / floorArea); |
| 428 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
2 | } else if (method == "AirChanges/Hour") { |
| 429 |
6/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
|
8 | return convert(airChangesperHour().get() * (airVolume / floorArea), "m/h", "m/s").get(); |
| 430 | } | ||
| 431 | |||
| 432 | ✗ | OS_ASSERT(false); | |
| 433 | ✗ | return 0.0; | |
| 434 | 3 | } | |
| 435 | |||
| 436 | 3 | double SpaceInfiltrationDesignFlowRate_Impl::getFlowPerExteriorSurfaceArea(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 437 | double airVolume) const { | ||
| 438 |
1/1✓ Branch 1 taken 3 times.
|
3 | std::string method = designFlowRateCalculationMethod(); |
| 439 | |||
| 440 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | if (method == "Flow/Space") { |
| 441 | ✗ | return designFlowRate().get() / exteriorSurfaceArea; | |
| 442 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | } else if (method == "Flow/Area") { |
| 443 | ✗ | return flowperSpaceFloorArea().get() * (floorArea / exteriorSurfaceArea); | |
| 444 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | } else if (method == "Flow/ExteriorArea") { |
| 445 | ✗ | return flowperExteriorSurfaceArea().get(); | |
| 446 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
|
3 | } else if (method == "Flow/ExteriorWallArea") { |
| 447 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return flowperExteriorWallArea().get() * (exteriorWallArea / exteriorSurfaceArea); |
| 448 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
2 | } else if (method == "AirChanges/Hour") { |
| 449 |
6/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
|
8 | return convert(airChangesperHour().get() * (airVolume / exteriorSurfaceArea), "m/h", "m/s").get(); |
| 450 | } | ||
| 451 | |||
| 452 | ✗ | OS_ASSERT(false); | |
| 453 | ✗ | return 0.0; | |
| 454 | 3 | } | |
| 455 | |||
| 456 | 3 | double SpaceInfiltrationDesignFlowRate_Impl::getFlowPerExteriorWallArea(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 457 | double airVolume) const { | ||
| 458 |
1/1✓ Branch 1 taken 3 times.
|
3 | std::string method = designFlowRateCalculationMethod(); |
| 459 | |||
| 460 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | if (method == "Flow/Space") { |
| 461 | ✗ | return designFlowRate().get() / exteriorWallArea; | |
| 462 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | } else if (method == "Flow/Area") { |
| 463 | ✗ | return flowperSpaceFloorArea().get() * (floorArea / exteriorWallArea); | |
| 464 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
3 | } else if (method == "Flow/ExteriorArea") { |
| 465 | ✗ | return flowperExteriorSurfaceArea().get() * (exteriorSurfaceArea / exteriorWallArea); | |
| 466 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
|
3 | } else if (method == "Flow/ExteriorWallArea") { |
| 467 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return flowperExteriorWallArea().get(); |
| 468 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
2 | } else if (method == "AirChanges/Hour") { |
| 469 |
6/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
|
8 | return convert(airChangesperHour().get() * (airVolume / exteriorWallArea), "m/h", "m/s").get(); |
| 470 | } | ||
| 471 | |||
| 472 | ✗ | OS_ASSERT(false); | |
| 473 | ✗ | return 0.0; | |
| 474 | 3 | } | |
| 475 | |||
| 476 | 10 | double SpaceInfiltrationDesignFlowRate_Impl::getAirChangesPerHour(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 477 | double airVolume) const { | ||
| 478 |
1/1✓ Branch 1 taken 10 times.
|
10 | std::string method = designFlowRateCalculationMethod(); |
| 479 | |||
| 480 |
2/3✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
|
10 | if (method == "Flow/Space") { |
| 481 | ✗ | return convert(designFlowRate().get() / airVolume, "1/s", "1/h").get(); | |
| 482 |
2/3✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
|
10 | } else if (method == "Flow/Area") { |
| 483 | ✗ | return convert(flowperSpaceFloorArea().get() * (floorArea / airVolume), "1/s", "1/h").get(); | |
| 484 |
2/3✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
|
10 | } else if (method == "Flow/ExteriorArea") { |
| 485 | ✗ | return convert(flowperExteriorSurfaceArea().get() * (exteriorSurfaceArea / airVolume), "1/s", "1/h").get(); | |
| 486 |
3/3✓ Branch 1 taken 10 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 9 times.
|
10 | } else if (method == "Flow/ExteriorWallArea") { |
| 487 |
6/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 16 taken 1 time.
|
4 | return convert(flowperExteriorWallArea().get() * (exteriorWallArea / airVolume), "1/s", "1/h").get(); |
| 488 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | } else if (method == "AirChanges/Hour") { |
| 489 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | return airChangesperHour().get(); |
| 490 | } | ||
| 491 | |||
| 492 | ✗ | OS_ASSERT(false); | |
| 493 | ✗ | return 0.0; | |
| 494 | 10 | } | |
| 495 | |||
| 496 | 538 | int SpaceInfiltrationDesignFlowRate_Impl::spaceIndex() const { | |
| 497 | 538 | return OS_SpaceInfiltration_DesignFlowRateFields::SpaceorSpaceTypeName; | |
| 498 | } | ||
| 499 | |||
| 500 | 90 | boost::optional<Schedule> SpaceInfiltrationDesignFlowRate_Impl::schedule() const { | |
| 501 | boost::optional<Schedule> result = | ||
| 502 |
2/2✓ Branch 1 taken 90 times.
✓ Branch 4 taken 90 times.
|
90 | getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_SpaceInfiltration_DesignFlowRateFields::ScheduleName); |
| 503 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 2 taken 8 times.
|
90 | if (!result) { |
| 504 | // search upwards | ||
| 505 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSpace space = this->space(); |
| 506 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSpaceType spaceType = this->spaceType(); |
| 507 |
2/2✓ Branch 0 taken 26 times.
✓ Branch 1 taken 56 times.
|
82 | if (space) { |
| 508 |
3/3✓ Branch 1 taken 26 times.
✓ Branch 4 taken 26 times.
✓ Branch 7 taken 26 times.
|
26 | result = space->getDefaultSchedule(DefaultScheduleType::InfiltrationSchedule); |
| 509 |
1/2✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
|
56 | } else if (spaceType) { |
| 510 |
3/3✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
✓ Branch 7 taken 56 times.
|
56 | result = spaceType->getDefaultSchedule(DefaultScheduleType::InfiltrationSchedule); |
| 511 | } | ||
| 512 | 82 | } | |
| 513 | 90 | return result; | |
| 514 | ✗ | } | |
| 515 | |||
| 516 | ✗ | bool SpaceInfiltrationDesignFlowRate_Impl::isScheduleDefaulted() const { | |
| 517 | ✗ | return isEmpty(OS_SpaceInfiltration_DesignFlowRateFields::ScheduleName); | |
| 518 | } | ||
| 519 | |||
| 520 | 59 | bool SpaceInfiltrationDesignFlowRate_Impl::setSchedule(Schedule& schedule) { | |
| 521 |
3/3✓ Branch 1 taken 59 times.
✓ Branch 4 taken 59 times.
✓ Branch 7 taken 59 times.
|
236 | bool result = ModelObject_Impl::setSchedule(OS_SpaceInfiltration_DesignFlowRateFields::ScheduleName, "SpaceInfiltrationDesignFlowRate", |
| 522 | "Infiltration", schedule); | ||
| 523 | 59 | return result; | |
| 524 | } | ||
| 525 | |||
| 526 | ✗ | void SpaceInfiltrationDesignFlowRate_Impl::resetSchedule() { | |
| 527 | ✗ | this->setString(OS_SpaceInfiltration_DesignFlowRateFields::ScheduleName, ""); | |
| 528 | ✗ | } | |
| 529 | |||
| 530 | ✗ | boost::optional<ModelObject> SpaceInfiltrationDesignFlowRate_Impl::scheduleAsModelObject() const { | |
| 531 | ✗ | OptionalModelObject result; | |
| 532 | ✗ | OptionalSchedule intermediate = schedule(); | |
| 533 | ✗ | if (intermediate) { | |
| 534 | ✗ | result = *intermediate; | |
| 535 | } | ||
| 536 | ✗ | return result; | |
| 537 | ✗ | } | |
| 538 | |||
| 539 | ✗ | bool SpaceInfiltrationDesignFlowRate_Impl::setScheduleAsModelObject(const boost::optional<ModelObject>& modelObject) { | |
| 540 | ✗ | if (modelObject) { | |
| 541 | ✗ | OptionalSchedule intermediate = modelObject->optionalCast<Schedule>(); | |
| 542 | ✗ | if (intermediate) { | |
| 543 | ✗ | Schedule schedule(*intermediate); | |
| 544 | ✗ | return setSchedule(schedule); | |
| 545 | ✗ | } else { | |
| 546 | ✗ | return false; | |
| 547 | } | ||
| 548 | ✗ | } else { | |
| 549 | ✗ | resetSchedule(); | |
| 550 | } | ||
| 551 | ✗ | return true; | |
| 552 | } | ||
| 553 | |||
| 554 | ✗ | std::vector<EMSActuatorNames> SpaceInfiltrationDesignFlowRate_Impl::emsActuatorNames() const { | |
| 555 | ✗ | std::vector<EMSActuatorNames> actuators{{"Zone Infiltration", "Air Exchange Flow Rate"}}; | |
| 556 | ✗ | return actuators; | |
| 557 | ✗ | } | |
| 558 | |||
| 559 | ✗ | std::vector<std::string> SpaceInfiltrationDesignFlowRate_Impl::emsInternalVariableNames() const { | |
| 560 | ✗ | std::vector<std::string> types; | |
| 561 | ✗ | return types; | |
| 562 | } | ||
| 563 | } // namespace detail | ||
| 564 | |||
| 565 | 73 | SpaceInfiltrationDesignFlowRate::SpaceInfiltrationDesignFlowRate(const Model& model) | |
| 566 | 73 | : SpaceLoad(SpaceInfiltrationDesignFlowRate::iddObjectType(), model) { | |
| 567 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 73 times.
✗ Branch 5 not taken.
|
73 | OS_ASSERT(getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()); |
| 568 |
1/1✓ Branch 1 taken 73 times.
|
73 | bool test = this->setDesignFlowRate(0); |
| 569 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 73 times.
✗ Branch 3 not taken.
|
73 | OS_ASSERT(test); |
| 570 |
2/2✓ Branch 1 taken 73 times.
✓ Branch 4 taken 73 times.
|
73 | setDensityBasis("Outdoor"); |
| 571 | 73 | } | |
| 572 | |||
| 573 | 12143 | IddObjectType SpaceInfiltrationDesignFlowRate::iddObjectType() { | |
| 574 |
1/1✓ Branch 1 taken 12143 times.
|
12143 | IddObjectType result(IddObjectType::OS_SpaceInfiltration_DesignFlowRate); |
| 575 | 12143 | return result; | |
| 576 | } | ||
| 577 | |||
| 578 | 70 | boost::optional<Schedule> SpaceInfiltrationDesignFlowRate::schedule() const { | |
| 579 |
1/1✓ Branch 3 taken 70 times.
|
70 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->schedule(); |
| 580 | } | ||
| 581 | |||
| 582 | ✗ | bool SpaceInfiltrationDesignFlowRate::isScheduleDefaulted() const { | |
| 583 | ✗ | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->isScheduleDefaulted(); | |
| 584 | } | ||
| 585 | |||
| 586 | 59 | bool SpaceInfiltrationDesignFlowRate::setSchedule(Schedule& schedule) { | |
| 587 |
1/1✓ Branch 3 taken 59 times.
|
59 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setSchedule(schedule); |
| 588 | } | ||
| 589 | |||
| 590 | ✗ | void SpaceInfiltrationDesignFlowRate::resetSchedule() { | |
| 591 | ✗ | getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->resetSchedule(); | |
| 592 | ✗ | } | |
| 593 | |||
| 594 | ✗ | std::vector<std::string> SpaceInfiltrationDesignFlowRate::designFlowRateCalculationMethodValues() { | |
| 595 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), | |
| 596 | ✗ | OS_SpaceInfiltration_DesignFlowRateFields::DesignFlowRateCalculationMethod); | |
| 597 | } | ||
| 598 | |||
| 599 | ✗ | std::vector<std::string> SpaceInfiltrationDesignFlowRate::validDesignFlowRateCalculationMethodValues() { | |
| 600 | ✗ | return SpaceInfiltrationDesignFlowRate::designFlowRateCalculationMethodValues(); | |
| 601 | } | ||
| 602 | |||
| 603 | ✗ | std::vector<std::string> SpaceInfiltrationDesignFlowRate::densityBasisValues() { | |
| 604 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_SpaceInfiltration_DesignFlowRateFields::DensityBasis); | |
| 605 | } | ||
| 606 | |||
| 607 | 72 | std::string SpaceInfiltrationDesignFlowRate::designFlowRateCalculationMethod() const { | |
| 608 |
1/1✓ Branch 3 taken 72 times.
|
72 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->designFlowRateCalculationMethod(); |
| 609 | } | ||
| 610 | |||
| 611 | 84 | boost::optional<double> SpaceInfiltrationDesignFlowRate::designFlowRate() const { | |
| 612 |
1/1✓ Branch 3 taken 84 times.
|
84 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->designFlowRate(); |
| 613 | } | ||
| 614 | |||
| 615 | 80 | boost::optional<double> SpaceInfiltrationDesignFlowRate::flowperSpaceFloorArea() const { | |
| 616 |
1/1✓ Branch 3 taken 80 times.
|
80 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->flowperSpaceFloorArea(); |
| 617 | } | ||
| 618 | |||
| 619 | 79 | boost::optional<double> SpaceInfiltrationDesignFlowRate::flowperExteriorSurfaceArea() const { | |
| 620 |
1/1✓ Branch 3 taken 79 times.
|
79 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->flowperExteriorSurfaceArea(); |
| 621 | } | ||
| 622 | |||
| 623 | 77 | boost::optional<double> SpaceInfiltrationDesignFlowRate::flowperExteriorWallArea() const { | |
| 624 |
1/1✓ Branch 3 taken 77 times.
|
77 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->flowperExteriorWallArea(); |
| 625 | } | ||
| 626 | |||
| 627 | 80 | boost::optional<double> SpaceInfiltrationDesignFlowRate::airChangesperHour() const { | |
| 628 |
1/1✓ Branch 3 taken 80 times.
|
80 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->airChangesperHour(); |
| 629 | } | ||
| 630 | |||
| 631 | 17 | double SpaceInfiltrationDesignFlowRate::constantTermCoefficient() const { | |
| 632 |
1/1✓ Branch 3 taken 17 times.
|
17 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->constantTermCoefficient(); |
| 633 | } | ||
| 634 | |||
| 635 | 70 | bool SpaceInfiltrationDesignFlowRate::isConstantTermCoefficientDefaulted() const { | |
| 636 |
1/1✓ Branch 3 taken 70 times.
|
70 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->isConstantTermCoefficientDefaulted(); |
| 637 | } | ||
| 638 | |||
| 639 | 10 | double SpaceInfiltrationDesignFlowRate::temperatureTermCoefficient() const { | |
| 640 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->temperatureTermCoefficient(); |
| 641 | } | ||
| 642 | |||
| 643 | 70 | bool SpaceInfiltrationDesignFlowRate::isTemperatureTermCoefficientDefaulted() const { | |
| 644 |
1/1✓ Branch 3 taken 70 times.
|
70 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->isTemperatureTermCoefficientDefaulted(); |
| 645 | } | ||
| 646 | |||
| 647 | 7 | double SpaceInfiltrationDesignFlowRate::velocityTermCoefficient() const { | |
| 648 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->velocityTermCoefficient(); |
| 649 | } | ||
| 650 | |||
| 651 | 70 | bool SpaceInfiltrationDesignFlowRate::isVelocityTermCoefficientDefaulted() const { | |
| 652 |
1/1✓ Branch 3 taken 70 times.
|
70 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->isVelocityTermCoefficientDefaulted(); |
| 653 | } | ||
| 654 | |||
| 655 | 7 | double SpaceInfiltrationDesignFlowRate::velocitySquaredTermCoefficient() const { | |
| 656 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->velocitySquaredTermCoefficient(); |
| 657 | } | ||
| 658 | |||
| 659 | 70 | bool SpaceInfiltrationDesignFlowRate::isVelocitySquaredTermCoefficientDefaulted() const { | |
| 660 |
1/1✓ Branch 3 taken 70 times.
|
70 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->isVelocitySquaredTermCoefficientDefaulted(); |
| 661 | } | ||
| 662 | |||
| 663 | 80 | bool SpaceInfiltrationDesignFlowRate::setDesignFlowRate(double designFlowRate) { | |
| 664 |
2/2✓ Branch 3 taken 80 times.
✓ Branch 6 taken 80 times.
|
80 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setDesignFlowRate(designFlowRate); |
| 665 | } | ||
| 666 | |||
| 667 | 2 | bool SpaceInfiltrationDesignFlowRate::setFlowperSpaceFloorArea(double flowperSpaceFloorArea) { | |
| 668 |
2/2✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
|
2 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setFlowperSpaceFloorArea(flowperSpaceFloorArea); |
| 669 | } | ||
| 670 | |||
| 671 | 28 | bool SpaceInfiltrationDesignFlowRate::setFlowperExteriorSurfaceArea(double flowperExteriorSurfaceArea) { | |
| 672 |
2/2✓ Branch 3 taken 28 times.
✓ Branch 6 taken 28 times.
|
28 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setFlowperExteriorSurfaceArea(flowperExteriorSurfaceArea); |
| 673 | } | ||
| 674 | |||
| 675 | 28 | bool SpaceInfiltrationDesignFlowRate::setFlowperExteriorWallArea(double flowperExteriorWallArea) { | |
| 676 |
2/2✓ Branch 3 taken 28 times.
✓ Branch 6 taken 28 times.
|
28 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setFlowperExteriorWallArea(flowperExteriorWallArea); |
| 677 | } | ||
| 678 | |||
| 679 | 14 | bool SpaceInfiltrationDesignFlowRate::setAirChangesperHour(double airChangesperHour) { | |
| 680 |
2/2✓ Branch 3 taken 14 times.
✓ Branch 6 taken 14 times.
|
14 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setAirChangesperHour(airChangesperHour); |
| 681 | } | ||
| 682 | |||
| 683 | 52 | bool SpaceInfiltrationDesignFlowRate::setConstantTermCoefficient(double constantTermCoefficient) { | |
| 684 |
1/1✓ Branch 3 taken 52 times.
|
52 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setConstantTermCoefficient(constantTermCoefficient); |
| 685 | } | ||
| 686 | |||
| 687 | ✗ | void SpaceInfiltrationDesignFlowRate::resetConstantTermCoefficient() { | |
| 688 | ✗ | getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->resetConstantTermCoefficient(); | |
| 689 | ✗ | } | |
| 690 | |||
| 691 | 54 | bool SpaceInfiltrationDesignFlowRate::setTemperatureTermCoefficient(double temperatureTermCoefficient) { | |
| 692 |
1/1✓ Branch 3 taken 54 times.
|
54 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setTemperatureTermCoefficient(temperatureTermCoefficient); |
| 693 | } | ||
| 694 | |||
| 695 | ✗ | void SpaceInfiltrationDesignFlowRate::resetTemperatureTermCoefficient() { | |
| 696 | ✗ | getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->resetTemperatureTermCoefficient(); | |
| 697 | ✗ | } | |
| 698 | |||
| 699 | 52 | bool SpaceInfiltrationDesignFlowRate::setVelocityTermCoefficient(double velocityTermCoefficient) { | |
| 700 |
1/1✓ Branch 3 taken 52 times.
|
52 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setVelocityTermCoefficient(velocityTermCoefficient); |
| 701 | } | ||
| 702 | |||
| 703 | ✗ | void SpaceInfiltrationDesignFlowRate::resetVelocityTermCoefficient() { | |
| 704 | ✗ | getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->resetVelocityTermCoefficient(); | |
| 705 | ✗ | } | |
| 706 | |||
| 707 | 52 | bool SpaceInfiltrationDesignFlowRate::setVelocitySquaredTermCoefficient(double velocitySquaredTermCoefficient) { | |
| 708 |
1/1✓ Branch 3 taken 52 times.
|
52 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setVelocitySquaredTermCoefficient(velocitySquaredTermCoefficient); |
| 709 | } | ||
| 710 | |||
| 711 | ✗ | void SpaceInfiltrationDesignFlowRate::resetVelocitySquaredTermCoefficient() { | |
| 712 | ✗ | getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->resetVelocitySquaredTermCoefficient(); | |
| 713 | ✗ | } | |
| 714 | |||
| 715 | 73 | std::string SpaceInfiltrationDesignFlowRate::densityBasis() const { | |
| 716 |
1/1✓ Branch 3 taken 73 times.
|
73 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->densityBasis(); |
| 717 | } | ||
| 718 | |||
| 719 | 75 | bool SpaceInfiltrationDesignFlowRate::setDensityBasis(const std::string& densityBasis) { | |
| 720 |
1/1✓ Branch 3 taken 75 times.
|
75 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->setDensityBasis(densityBasis); |
| 721 | } | ||
| 722 | |||
| 723 | 13 | double SpaceInfiltrationDesignFlowRate::getDesignFlowRate(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 724 | double airVolume) const { | ||
| 725 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->getDesignFlowRate(floorArea, exteriorSurfaceArea, exteriorWallArea, airVolume); |
| 726 | } | ||
| 727 | |||
| 728 | 3 | double SpaceInfiltrationDesignFlowRate::getFlowPerSpaceFloorArea(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 729 | double airVolume) const { | ||
| 730 |
1/1✓ Branch 3 taken 3 times.
|
6 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->getFlowPerSpaceFloorArea(floorArea, exteriorSurfaceArea, exteriorWallArea, |
| 731 | 6 | airVolume); | |
| 732 | } | ||
| 733 | |||
| 734 | 3 | double SpaceInfiltrationDesignFlowRate::getFlowPerExteriorSurfaceArea(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 735 | double airVolume) const { | ||
| 736 |
1/1✓ Branch 3 taken 3 times.
|
6 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->getFlowPerExteriorSurfaceArea(floorArea, exteriorSurfaceArea, exteriorWallArea, |
| 737 | 6 | airVolume); | |
| 738 | } | ||
| 739 | |||
| 740 | 3 | double SpaceInfiltrationDesignFlowRate::getFlowPerExteriorWallArea(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 741 | double airVolume) const { | ||
| 742 |
1/1✓ Branch 3 taken 3 times.
|
6 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->getFlowPerExteriorWallArea(floorArea, exteriorSurfaceArea, exteriorWallArea, |
| 743 | 6 | airVolume); | |
| 744 | } | ||
| 745 | |||
| 746 | 10 | double SpaceInfiltrationDesignFlowRate::getAirChangesPerHour(double floorArea, double exteriorSurfaceArea, double exteriorWallArea, | |
| 747 | double airVolume) const { | ||
| 748 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::SpaceInfiltrationDesignFlowRate_Impl>()->getAirChangesPerHour(floorArea, exteriorSurfaceArea, exteriorWallArea, airVolume); |
| 749 | } | ||
| 750 | |||
| 751 | /// @cond | ||
| 752 | 257 | SpaceInfiltrationDesignFlowRate::SpaceInfiltrationDesignFlowRate(std::shared_ptr<detail::SpaceInfiltrationDesignFlowRate_Impl> impl) | |
| 753 |
1/1✓ Branch 3 taken 257 times.
|
257 | : SpaceLoad(std::move(impl)) {} |
| 754 | /// @endcond | ||
| 755 | |||
| 756 | } // namespace model | ||
| 757 | } // namespace openstudio | ||
| 758 |