src/model/CoilCoolingWater.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 "CoilCoolingWater.hpp" | ||
| 7 | #include "CoilCoolingWater_Impl.hpp" | ||
| 8 | #include "ControllerWaterCoil.hpp" | ||
| 9 | #include "ControllerWaterCoil_Impl.hpp" | ||
| 10 | #include "CoilSystemCoolingWater.hpp" | ||
| 11 | #include "CoilSystemCoolingWater_Impl.hpp" | ||
| 12 | #include "CoilSystemCoolingWaterHeatExchangerAssisted.hpp" | ||
| 13 | #include "CoilSystemCoolingWaterHeatExchangerAssisted_Impl.hpp" | ||
| 14 | #include "Node.hpp" | ||
| 15 | #include "Node_Impl.hpp" | ||
| 16 | #include "Model.hpp" | ||
| 17 | #include "ScheduleCompact.hpp" | ||
| 18 | #include "ScheduleCompact_Impl.hpp" | ||
| 19 | #include "AirLoopHVACUnitarySystem.hpp" | ||
| 20 | #include "AirLoopHVACUnitarySystem_Impl.hpp" | ||
| 21 | #include "ZoneHVACComponent.hpp" | ||
| 22 | #include "ZoneHVACComponent_Impl.hpp" | ||
| 23 | #include "ZoneHVACFourPipeFanCoil.hpp" | ||
| 24 | #include "ZoneHVACFourPipeFanCoil_Impl.hpp" | ||
| 25 | #include "ZoneHVACUnitVentilator.hpp" | ||
| 26 | #include "ZoneHVACUnitVentilator_Impl.hpp" | ||
| 27 | |||
| 28 | #include "AirflowNetworkEquivalentDuct.hpp" | ||
| 29 | #include "AirflowNetworkEquivalentDuct_Impl.hpp" | ||
| 30 | #include "AirTerminalSingleDuctConstantVolumeFourPipeInduction.hpp" | ||
| 31 | #include "AirTerminalSingleDuctConstantVolumeFourPipeInduction_Impl.hpp" | ||
| 32 | #include <utilities/idd/OS_Coil_Cooling_Water_FieldEnums.hxx> | ||
| 33 | #include <utilities/idd/IddEnums.hxx> | ||
| 34 | #include "../utilities/core/Compare.hpp" | ||
| 35 | #include "../utilities/core/Assert.hpp" | ||
| 36 | #include "../utilities/data/DataEnums.hpp" | ||
| 37 | |||
| 38 | namespace openstudio { | ||
| 39 | namespace model { | ||
| 40 | |||
| 41 | namespace detail { | ||
| 42 | |||
| 43 | 82 | CoilCoolingWater_Impl::CoilCoolingWater_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 44 | 82 | : WaterToAirComponent_Impl(idfObject, model, keepHandle) { | |
| 45 |
4/6✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
✓ Branch 7 taken 82 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 82 times.
✗ Branch 13 not taken.
|
82 | OS_ASSERT(idfObject.iddObject().type() == CoilCoolingWater::iddObjectType()); |
| 46 | 82 | } | |
| 47 | |||
| 48 | 1 | CoilCoolingWater_Impl::CoilCoolingWater_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 49 | 1 | : WaterToAirComponent_Impl(other, model, keepHandle) { | |
| 50 |
4/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
|
1 | OS_ASSERT(other.iddObject().type() == CoilCoolingWater::iddObjectType()); |
| 51 | 1 | } | |
| 52 | |||
| 53 | 49 | CoilCoolingWater_Impl::CoilCoolingWater_Impl(const CoilCoolingWater_Impl& other, Model_Impl* model, bool keepHandle) | |
| 54 | 49 | : WaterToAirComponent_Impl(other, model, keepHandle) {} | |
| 55 | |||
| 56 | ✗ | const std::vector<std::string>& CoilCoolingWater_Impl::outputVariableNames() const { | |
| 57 | static const std::vector<std::string> result{"Cooling Coil Total Cooling Energy", | ||
| 58 | "Cooling Coil Sensible Cooling Energy", | ||
| 59 | "Cooling Coil Total Cooling Rate", | ||
| 60 | "Cooling Coil Sensible Cooling Rate", | ||
| 61 | "Cooling Coil Wetted Area Fraction", | ||
| 62 | "Cooling Coil Condensate Volume Flow Rate", | ||
| 63 | "Cooling Coil Source Side Heat Transfer Energy", | ||
| 64 | ✗ | "Cooling Coil Condensate Volume"}; | |
| 65 | ✗ | return result; | |
| 66 | ✗ | } | |
| 67 | |||
| 68 | 797 | IddObjectType CoilCoolingWater_Impl::iddObjectType() const { | |
| 69 | 797 | return CoilCoolingWater::iddObjectType(); | |
| 70 | } | ||
| 71 | |||
| 72 | 30 | std::vector<ModelObject> CoilCoolingWater_Impl::children() const { | |
| 73 | 30 | std::vector<ModelObject> result; | |
| 74 | std::vector<AirflowNetworkEquivalentDuct> myAFNItems = | ||
| 75 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
|
30 | getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType()); |
| 76 |
1/1✓ Branch 5 taken 30 times.
|
30 | result.insert(result.end(), myAFNItems.begin(), myAFNItems.end()); |
| 77 | 60 | return result; | |
| 78 | 30 | } | |
| 79 | |||
| 80 | ✗ | std::vector<ScheduleTypeKey> CoilCoolingWater_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 81 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 82 | ✗ | UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 83 | ✗ | UnsignedVector::const_iterator b(fieldIndices.begin()); | |
| 84 | ✗ | UnsignedVector::const_iterator e(fieldIndices.end()); | |
| 85 | ✗ | if (std::find(b, e, OS_Coil_Cooling_WaterFields::AvailabilityScheduleName) != e) { | |
| 86 | ✗ | result.push_back(ScheduleTypeKey("CoilCoolingWater", "Availability")); | |
| 87 | } | ||
| 88 | ✗ | return result; | |
| 89 | ✗ | } | |
| 90 | |||
| 91 | 13 | Schedule CoilCoolingWater_Impl::availabilitySchedule() const { | |
| 92 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
|
13 | OptionalSchedule value = getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Coil_Cooling_WaterFields::AvailabilityScheduleName); |
| 93 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 13 times.
|
13 | if (!value) { |
| 94 | // it is an error if we get here, however we don't want to crash | ||
| 95 | // so we hook up to global always on schedule | ||
| 96 | ✗ | LOG(Error, "Required availability schedule not set, using 'Always On' schedule"); | |
| 97 | ✗ | value = this->model().alwaysOnDiscreteSchedule(); | |
| 98 | ✗ | OS_ASSERT(value); | |
| 99 | ✗ | const_cast<CoilCoolingWater_Impl*>(this)->setAvailabilitySchedule(*value); | |
| 100 | ✗ | value = getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Coil_Cooling_WaterFields::AvailabilityScheduleName); | |
| 101 | } | ||
| 102 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 13 times.
✗ Branch 4 not taken.
|
13 | OS_ASSERT(value); |
| 103 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
|
26 | return value.get(); |
| 104 | 13 | } | |
| 105 | |||
| 106 | 81 | bool CoilCoolingWater_Impl::setAvailabilitySchedule(Schedule& schedule) { | |
| 107 |
3/3✓ Branch 1 taken 81 times.
✓ Branch 4 taken 81 times.
✓ Branch 7 taken 81 times.
|
324 | bool result = setSchedule(OS_Coil_Cooling_WaterFields::AvailabilityScheduleName, "CoilCoolingWater", "Availability", schedule); |
| 108 | 81 | return result; | |
| 109 | } | ||
| 110 | |||
| 111 | 5 | boost::optional<double> CoilCoolingWater_Impl::designWaterFlowRate() { | |
| 112 | 5 | return getDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignWaterFlowRate); | |
| 113 | } | ||
| 114 | |||
| 115 | 5 | bool CoilCoolingWater_Impl::setDesignWaterFlowRate(double value) { | |
| 116 | 5 | return setDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignWaterFlowRate, value); | |
| 117 | } | ||
| 118 | |||
| 119 | 13 | bool CoilCoolingWater_Impl::isDesignWaterFlowRateAutosized() { | |
| 120 | 13 | bool result = false; | |
| 121 |
1/1✓ Branch 1 taken 13 times.
|
13 | boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterFields::DesignWaterFlowRate, true); |
| 122 |
1/2✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
|
13 | if (value) { |
| 123 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
26 | result = openstudio::istringEqual(value.get(), "Autosize"); |
| 124 | } | ||
| 125 | 13 | return result; | |
| 126 | 13 | } | |
| 127 | |||
| 128 | ✗ | void CoilCoolingWater_Impl::autosizeDesignWaterFlowRate() { | |
| 129 | ✗ | setString(OS_Coil_Cooling_WaterFields::DesignWaterFlowRate, "Autosize"); | |
| 130 | ✗ | } | |
| 131 | |||
| 132 | ✗ | boost::optional<double> CoilCoolingWater_Impl::designAirFlowRate() { | |
| 133 | ✗ | return getDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignAirFlowRate); | |
| 134 | } | ||
| 135 | |||
| 136 | 5 | bool CoilCoolingWater_Impl::setDesignAirFlowRate(double value) { | |
| 137 | 5 | return setDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignAirFlowRate, value); | |
| 138 | } | ||
| 139 | |||
| 140 | 13 | bool CoilCoolingWater_Impl::isDesignAirFlowRateAutosized() { | |
| 141 | 13 | bool result = false; | |
| 142 |
1/1✓ Branch 1 taken 13 times.
|
13 | boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterFields::DesignAirFlowRate, true); |
| 143 |
1/2✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
|
13 | if (value) { |
| 144 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
26 | result = openstudio::istringEqual(value.get(), "Autosize"); |
| 145 | } | ||
| 146 | 13 | return result; | |
| 147 | 13 | } | |
| 148 | |||
| 149 | ✗ | void CoilCoolingWater_Impl::autosizeDesignAirFlowRate() { | |
| 150 | ✗ | setString(OS_Coil_Cooling_WaterFields::DesignAirFlowRate, "Autosize"); | |
| 151 | ✗ | } | |
| 152 | |||
| 153 | ✗ | boost::optional<double> CoilCoolingWater_Impl::designInletWaterTemperature() { | |
| 154 | ✗ | return getDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignInletWaterTemperature); | |
| 155 | } | ||
| 156 | |||
| 157 | 10 | bool CoilCoolingWater_Impl::setDesignInletWaterTemperature(double value) { | |
| 158 | 10 | return setDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignInletWaterTemperature, value); | |
| 159 | } | ||
| 160 | |||
| 161 | 13 | bool CoilCoolingWater_Impl::isDesignInletWaterTemperatureAutosized() { | |
| 162 | 13 | bool result = false; | |
| 163 |
1/1✓ Branch 1 taken 13 times.
|
13 | boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterFields::DesignInletWaterTemperature, true); |
| 164 |
1/2✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
|
13 | if (value) { |
| 165 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
26 | result = openstudio::istringEqual(value.get(), "Autosize"); |
| 166 | } | ||
| 167 | 13 | return result; | |
| 168 | 13 | } | |
| 169 | |||
| 170 | ✗ | void CoilCoolingWater_Impl::autosizeDesignInletWaterTemperature() { | |
| 171 | ✗ | setString(OS_Coil_Cooling_WaterFields::DesignInletWaterTemperature, "Autosize"); | |
| 172 | ✗ | } | |
| 173 | |||
| 174 | ✗ | boost::optional<double> CoilCoolingWater_Impl::designInletAirTemperature() { | |
| 175 | ✗ | return getDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignInletAirTemperature); | |
| 176 | } | ||
| 177 | |||
| 178 | ✗ | bool CoilCoolingWater_Impl::setDesignInletAirTemperature(double value) { | |
| 179 | ✗ | return setDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignInletAirTemperature, value); | |
| 180 | } | ||
| 181 | |||
| 182 | 13 | bool CoilCoolingWater_Impl::isDesignInletAirTemperatureAutosized() { | |
| 183 | 13 | bool result = false; | |
| 184 |
1/1✓ Branch 1 taken 13 times.
|
13 | boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterFields::DesignInletAirTemperature, true); |
| 185 |
1/2✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
|
13 | if (value) { |
| 186 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
26 | result = openstudio::istringEqual(value.get(), "Autosize"); |
| 187 | } | ||
| 188 | 13 | return result; | |
| 189 | 13 | } | |
| 190 | |||
| 191 | 5 | void CoilCoolingWater_Impl::autosizeDesignInletAirTemperature() { | |
| 192 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
10 | setString(OS_Coil_Cooling_WaterFields::DesignInletAirTemperature, "Autosize"); |
| 193 | 5 | } | |
| 194 | |||
| 195 | ✗ | boost::optional<double> CoilCoolingWater_Impl::designOutletAirTemperature() { | |
| 196 | ✗ | return getDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignOutletAirTemperature); | |
| 197 | } | ||
| 198 | |||
| 199 | ✗ | bool CoilCoolingWater_Impl::setDesignOutletAirTemperature(double value) { | |
| 200 | ✗ | return setDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignOutletAirTemperature, value); | |
| 201 | } | ||
| 202 | |||
| 203 | 13 | bool CoilCoolingWater_Impl::isDesignOutletAirTemperatureAutosized() { | |
| 204 | 13 | bool result = false; | |
| 205 |
1/1✓ Branch 1 taken 13 times.
|
13 | boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterFields::DesignOutletAirTemperature, true); |
| 206 |
1/2✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
|
13 | if (value) { |
| 207 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
26 | result = openstudio::istringEqual(value.get(), "Autosize"); |
| 208 | } | ||
| 209 | 13 | return result; | |
| 210 | 13 | } | |
| 211 | |||
| 212 | 5 | void CoilCoolingWater_Impl::autosizeDesignOutletAirTemperature() { | |
| 213 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
10 | setString(OS_Coil_Cooling_WaterFields::DesignOutletAirTemperature, "Autosize"); |
| 214 | 5 | } | |
| 215 | |||
| 216 | ✗ | boost::optional<double> CoilCoolingWater_Impl::designInletAirHumidityRatio() { | |
| 217 | ✗ | return getDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignInletAirHumidityRatio); | |
| 218 | } | ||
| 219 | |||
| 220 | ✗ | bool CoilCoolingWater_Impl::setDesignInletAirHumidityRatio(double value) { | |
| 221 | ✗ | return setDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignInletAirHumidityRatio, value); | |
| 222 | } | ||
| 223 | |||
| 224 | 13 | bool CoilCoolingWater_Impl::isDesignInletAirHumidityRatioAutosized() { | |
| 225 | 13 | bool result = false; | |
| 226 |
1/1✓ Branch 1 taken 13 times.
|
13 | boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterFields::DesignInletAirHumidityRatio, true); |
| 227 |
1/2✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
|
13 | if (value) { |
| 228 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
26 | result = openstudio::istringEqual(value.get(), "Autosize"); |
| 229 | } | ||
| 230 | 13 | return result; | |
| 231 | 13 | } | |
| 232 | |||
| 233 | 5 | void CoilCoolingWater_Impl::autosizeDesignInletAirHumidityRatio() { | |
| 234 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
10 | setString(OS_Coil_Cooling_WaterFields::DesignInletAirHumidityRatio, "Autosize"); |
| 235 | 5 | } | |
| 236 | |||
| 237 | ✗ | boost::optional<double> CoilCoolingWater_Impl::designOutletAirHumidityRatio() { | |
| 238 | ✗ | return getDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignOutletAirHumidityRatio); | |
| 239 | } | ||
| 240 | |||
| 241 | ✗ | bool CoilCoolingWater_Impl::setDesignOutletAirHumidityRatio(double value) { | |
| 242 | ✗ | return setDouble(openstudio::OS_Coil_Cooling_WaterFields::DesignOutletAirHumidityRatio, value); | |
| 243 | ; | ||
| 244 | } | ||
| 245 | |||
| 246 | 13 | bool CoilCoolingWater_Impl::isDesignOutletAirHumidityRatioAutosized() { | |
| 247 | 13 | bool result = false; | |
| 248 |
1/1✓ Branch 1 taken 13 times.
|
13 | boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterFields::DesignOutletAirHumidityRatio, true); |
| 249 |
1/2✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
|
13 | if (value) { |
| 250 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
26 | result = openstudio::istringEqual(value.get(), "Autosize"); |
| 251 | } | ||
| 252 | 13 | return result; | |
| 253 | 13 | } | |
| 254 | |||
| 255 | 5 | void CoilCoolingWater_Impl::autosizeDesignOutletAirHumidityRatio() { | |
| 256 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
10 | setString(OS_Coil_Cooling_WaterFields::DesignOutletAirHumidityRatio, "Autosize"); |
| 257 | 5 | } | |
| 258 | |||
| 259 | 13 | std::string CoilCoolingWater_Impl::typeOfAnalysis() { | |
| 260 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
13 | return getString(openstudio::OS_Coil_Cooling_WaterFields::TypeofAnalysis, true).get(); |
| 261 | } | ||
| 262 | |||
| 263 | 5 | bool CoilCoolingWater_Impl::setTypeOfAnalysis(const std::string& value) { | |
| 264 | 5 | return setString(openstudio::OS_Coil_Cooling_WaterFields::TypeofAnalysis, value); | |
| 265 | } | ||
| 266 | |||
| 267 | 13 | std::string CoilCoolingWater_Impl::heatExchangerConfiguration() { | |
| 268 |
3/3✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
|
13 | return getString(openstudio::OS_Coil_Cooling_WaterFields::HeatExchangerConfiguration, true).get(); |
| 269 | } | ||
| 270 | |||
| 271 | ✗ | bool CoilCoolingWater_Impl::setHeatExchangerConfiguration(const std::string& value) { | |
| 272 | ✗ | return setString(openstudio::OS_Coil_Cooling_WaterFields::HeatExchangerConfiguration, value); | |
| 273 | } | ||
| 274 | |||
| 275 | 76 | bool CoilCoolingWater_Impl::addToNode(Node& node) { | |
| 276 | 76 | bool success = false; | |
| 277 | |||
| 278 |
1/1✓ Branch 1 taken 76 times.
|
76 | auto t_containingHVACComponent = containingHVACComponent(); |
| 279 |
1/1✓ Branch 1 taken 76 times.
|
76 | auto t_airLoop = node.airLoopHVAC(); |
| 280 | |||
| 281 | // Reject adding coils parent of a Parent System | ||
| 282 |
6/6✓ Branch 0 taken 30 times.
✓ Branch 1 taken 46 times.
✓ Branch 2 taken 7 times.
✓ Branch 3 taken 23 times.
✓ Branch 4 taken 7 times.
✓ Branch 5 taken 69 times.
|
106 | if (t_airLoop && t_containingHVACComponent) { |
| 283 |
4/4✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 6 times.
|
14 | if (t_containingHVACComponent->optionalCast<CoilSystemCoolingWaterHeatExchangerAssisted>()) { |
| 284 |
7/7✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
|
1 | LOG(Warn, this->briefDescription() |
| 285 | << " cannot be connected directly to an AirLoopHVAC when it's part of a parent CoilSystemCoolingWaterHeatExchangerAssisted. " | ||
| 286 | "Please call CoilSystemCoolingWaterHeatExchangerAssisted::addToNode instead"); | ||
| 287 | 1 | return false; | |
| 288 | } | ||
| 289 | |||
| 290 |
3/5✓ Branch 1 taken 6 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
|
12 | if (t_containingHVACComponent->optionalCast<CoilSystemCoolingWater>() |
| 291 |
13/21✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 6 times.
✓ Branch 10 taken 6 times.
✓ Branch 13 taken 6 times.
✓ Branch 16 taken 6 times.
✓ Branch 19 taken 6 times.
✓ Branch 22 taken 6 times.
✓ Branch 24 taken 2 times.
✓ Branch 25 taken 4 times.
✓ Branch 26 taken 6 times.
✗ Branch 27 not taken.
✓ Branch 29 taken 6 times.
✗ Branch 30 not taken.
✓ Branch 32 taken 6 times.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
|
18 | && t_containingHVACComponent->cast<CoilSystemCoolingWater>().coolingCoil().handle() == this->handle()) { |
| 292 |
7/7✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 14 taken 2 times.
✓ Branch 17 taken 2 times.
✓ Branch 20 taken 2 times.
|
2 | LOG(Warn, this->briefDescription() |
| 293 | << " cannot be connected directly to an AirLoopHVAC when it's the primary cooling coil of a parent CoilSystemCoolingWater. " | ||
| 294 | "Please call CoilSystemCoolingWater::addToNode instead"); | ||
| 295 | 2 | return false; | |
| 296 | } | ||
| 297 | } | ||
| 298 | |||
| 299 |
1/1✓ Branch 1 taken 73 times.
|
73 | success = WaterToAirComponent_Impl::addToNode(node); |
| 300 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 73 times.
|
73 | if (!success) { |
| 301 | ✗ | return false; | |
| 302 | } | ||
| 303 | // We only add the controller if we are not part of a containing ZoneHVACComponent, and we have a PlantLoop assigned | ||
| 304 |
11/16✓ Branch 1 taken 73 times.
✓ Branch 4 taken 72 times.
✓ Branch 5 taken 1 time.
✓ Branch 7 taken 72 times.
✓ Branch 10 taken 23 times.
✓ Branch 11 taken 49 times.
✓ Branch 12 taken 72 times.
✓ Branch 13 taken 1 time.
✓ Branch 15 taken 73 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 24 times.
✓ Branch 19 taken 49 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
|
146 | if (containingZoneHVACComponent() || !waterInletModelObject()) { |
| 305 | // We're done | ||
| 306 | 24 | return true; | |
| 307 | } | ||
| 308 | |||
| 309 | // We don't need a controller if we are part of a CoilSystemCoolingWater (directly, or indirectly via a | ||
| 310 | // CoilSystemCoolingWaterHeatExchangerAssisted) | ||
| 311 | 49 | bool needAController = true; | |
| 312 |
2/2✓ Branch 0 taken 19 times.
✓ Branch 1 taken 30 times.
|
49 | if (t_containingHVACComponent) { |
| 313 |
4/4✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 11 times.
|
38 | if (t_containingHVACComponent->optionalCast<CoilSystemCoolingWater>()) { |
| 314 | 8 | needAController = false; | |
| 315 |
4/4✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 6 taken 7 times.
✓ Branch 7 taken 4 times.
|
22 | } else if (auto hxAssisted_ = t_containingHVACComponent->optionalCast<CoilSystemCoolingWaterHeatExchangerAssisted>()) { |
| 316 |
4/4✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 6 taken 3 times.
✓ Branch 7 taken 4 times.
|
14 | if (auto parent_ = hxAssisted_->containingHVACComponent()) { |
| 317 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 1 time.
|
6 | if (parent_->optionalCast<CoilSystemCoolingWater>()) { |
| 318 | 2 | needAController = false; | |
| 319 | } | ||
| 320 | 7 | } | |
| 321 | 11 | } | |
| 322 | } | ||
| 323 | |||
| 324 |
3/3✓ Branch 1 taken 49 times.
✓ Branch 3 taken 7 times.
✓ Branch 4 taken 42 times.
|
98 | if (auto oldController_ = controllerWaterCoil()) { |
| 325 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
|
7 | if (!needAController) { |
| 326 | ✗ | oldController_->remove(); | |
| 327 |
6/7✓ 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 17 not taken.
✓ Branch 18 taken 7 times.
|
14 | } else if (!openstudio::istringEqual(oldController_->action().get(), "Reverse")) { |
| 328 | ✗ | LOG(Warn, briefDescription() | |
| 329 | << " has an existing ControllerWaterCoil with action set to something else than 'Reverse'. Make sure this is what you want"); | ||
| 330 | } | ||
| 331 |
2/2✓ Branch 0 taken 32 times.
✓ Branch 1 taken 10 times.
|
42 | } else if (needAController) { |
| 332 |
1/1✓ Branch 1 taken 32 times.
|
32 | Model t_model = model(); |
| 333 |
1/1✓ Branch 1 taken 32 times.
|
32 | ControllerWaterCoil controller(t_model); |
| 334 |
2/2✓ Branch 3 taken 32 times.
✓ Branch 6 taken 32 times.
|
32 | controller.getImpl<ControllerWaterCoil_Impl>()->setWaterCoil(getObject<HVACComponent>()); |
| 335 |
2/2✓ Branch 1 taken 32 times.
✓ Branch 4 taken 32 times.
|
32 | controller.setAction("Reverse"); |
| 336 | 81 | } | |
| 337 | |||
| 338 | 49 | return success; | |
| 339 | 76 | } | |
| 340 | |||
| 341 | 58 | bool CoilCoolingWater_Impl::removeFromPlantLoop() { | |
| 342 |
3/3✓ Branch 1 taken 58 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 52 times.
|
116 | if (boost::optional<ControllerWaterCoil> controller = this->controllerWaterCoil()) { |
| 343 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | controller->remove(); |
| 344 | 58 | } | |
| 345 | |||
| 346 | 58 | return WaterToAirComponent_Impl::removeFromPlantLoop(); | |
| 347 | } | ||
| 348 | |||
| 349 | 9 | std::vector<openstudio::IdfObject> CoilCoolingWater_Impl::remove() { | |
| 350 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 2 taken 3 times.
|
9 | if (isRemovable()) { |
| 351 | 6 | return WaterToAirComponent_Impl::remove(); | |
| 352 | } | ||
| 353 | |||
| 354 | 3 | return {}; | |
| 355 | } | ||
| 356 | |||
| 357 | 18 | ModelObject CoilCoolingWater_Impl::clone(Model model) const { | |
| 358 |
2/2✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
|
18 | return WaterToAirComponent_Impl::clone(model); |
| 359 | } | ||
| 360 | |||
| 361 | 1977 | unsigned CoilCoolingWater_Impl::airInletPort() const { | |
| 362 | 1977 | return OS_Coil_Cooling_WaterFields::AirInletNodeName; | |
| 363 | } | ||
| 364 | |||
| 365 | 1943 | unsigned CoilCoolingWater_Impl::airOutletPort() const { | |
| 366 | 1943 | return OS_Coil_Cooling_WaterFields::AirOutletNodeName; | |
| 367 | } | ||
| 368 | |||
| 369 | 2530 | unsigned CoilCoolingWater_Impl::waterInletPort() const { | |
| 370 | 2530 | return OS_Coil_Cooling_WaterFields::WaterInletNodeName; | |
| 371 | } | ||
| 372 | |||
| 373 | 640 | unsigned CoilCoolingWater_Impl::waterOutletPort() const { | |
| 374 | 640 | return OS_Coil_Cooling_WaterFields::WaterOutletNodeName; | |
| 375 | } | ||
| 376 | |||
| 377 | ✗ | boost::optional<ModelObject> CoilCoolingWater_Impl::availabilityScheduleAsModelObject() const { | |
| 378 | ✗ | OptionalModelObject result = availabilitySchedule(); | |
| 379 | ✗ | return result; | |
| 380 | } | ||
| 381 | |||
| 382 | ✗ | bool CoilCoolingWater_Impl::setAvailabilityScheduleAsModelObject(const boost::optional<ModelObject>& modelObject) { | |
| 383 | ✗ | if (modelObject) { | |
| 384 | ✗ | OptionalSchedule intermediate = modelObject->optionalCast<Schedule>(); | |
| 385 | ✗ | if (intermediate) { | |
| 386 | ✗ | Schedule schedule(*intermediate); | |
| 387 | ✗ | return setAvailabilitySchedule(schedule); | |
| 388 | ✗ | } | |
| 389 | ✗ | } | |
| 390 | ✗ | return false; | |
| 391 | } | ||
| 392 | |||
| 393 | 115 | boost::optional<HVACComponent> CoilCoolingWater_Impl::containingHVACComponent() const { | |
| 394 | // AirLoopHVACUnitarySystem | ||
| 395 |
2/2✓ Branch 1 taken 115 times.
✓ Branch 4 taken 115 times.
|
115 | std::vector<AirLoopHVACUnitarySystem> airLoopHVACUnitarySystems = this->model().getConcreteModelObjects<AirLoopHVACUnitarySystem>(); |
| 396 | |||
| 397 |
2/2✓ Branch 5 taken 7 times.
✓ Branch 6 taken 110 times.
|
117 | for (const auto& airLoopHVACUnitarySystem : airLoopHVACUnitarySystems) { |
| 398 |
2/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
|
14 | if (boost::optional<HVACComponent> coolingCoil = airLoopHVACUnitarySystem.coolingCoil()) { |
| 399 |
6/6✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 7 times.
✓ Branch 12 taken 5 times.
✓ Branch 13 taken 2 times.
|
7 | if (coolingCoil->handle() == this->handle()) { |
| 400 |
1/1✓ Branch 1 taken 5 times.
|
5 | return airLoopHVACUnitarySystem; |
| 401 | } | ||
| 402 | 7 | } | |
| 403 | } | ||
| 404 | |||
| 405 | // CoilSystemCoolingWater | ||
| 406 | { | ||
| 407 |
2/2✓ Branch 1 taken 110 times.
✓ Branch 4 taken 110 times.
|
110 | auto coilSystems = model().getConcreteModelObjects<CoilSystemCoolingWater>(); |
| 408 |
2/2✓ Branch 5 taken 24 times.
✓ Branch 6 taken 89 times.
|
113 | for (const auto& coilSystem : coilSystems) { |
| 409 |
6/6✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
✓ Branch 13 taken 11 times.
✓ Branch 14 taken 13 times.
|
24 | if (coilSystem.coolingCoil().handle() == handle()) { |
| 410 |
1/1✓ Branch 1 taken 11 times.
|
32 | return coilSystem; |
| 411 | } | ||
| 412 |
2/3✓ Branch 1 taken 13 times.
✓ Branch 3 taken 13 times.
✗ Branch 4 not taken.
|
26 | if (boost::optional<HVACComponent> companionCoilUsedForHeatRecovery = coilSystem.companionCoilUsedForHeatRecovery()) { |
| 413 |
6/6✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
✓ Branch 10 taken 13 times.
✓ Branch 12 taken 10 times.
✓ Branch 13 taken 3 times.
|
13 | if (companionCoilUsedForHeatRecovery->handle() == this->handle()) { |
| 414 |
1/1✓ Branch 1 taken 10 times.
|
10 | return coilSystem; |
| 415 | } | ||
| 416 | 13 | } | |
| 417 | } | ||
| 418 | 110 | } | |
| 419 | |||
| 420 | // CoilSystemCoolingWaterHeatExchangerAssisted | ||
| 421 | { | ||
| 422 |
2/2✓ Branch 1 taken 89 times.
✓ Branch 4 taken 89 times.
|
89 | auto coilSystems = model().getConcreteModelObjects<CoilSystemCoolingWaterHeatExchangerAssisted>(); |
| 423 |
2/2✓ Branch 5 taken 13 times.
✓ Branch 6 taken 76 times.
|
89 | for (const auto& coilSystem : coilSystems) { |
| 424 |
5/6✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
✓ Branch 10 taken 13 times.
✓ Branch 13 taken 13 times.
✗ Branch 14 not taken.
|
13 | if (coilSystem.coolingCoil().handle() == handle()) { |
| 425 |
1/1✓ Branch 1 taken 13 times.
|
13 | return coilSystem; |
| 426 | } | ||
| 427 | } | ||
| 428 | 89 | } | |
| 429 | |||
| 430 | // AirTerminalSingleDuctConstantVolumeFourPipeInduction | ||
| 431 | std::vector<AirTerminalSingleDuctConstantVolumeFourPipeInduction> fourPipeSystems = | ||
| 432 |
2/2✓ Branch 1 taken 76 times.
✓ Branch 4 taken 76 times.
|
76 | this->model().getConcreteModelObjects<AirTerminalSingleDuctConstantVolumeFourPipeInduction>(); |
| 433 | |||
| 434 |
2/2✓ Branch 5 taken 4 times.
✓ Branch 6 taken 72 times.
|
76 | for (const auto& fourPipeSystem : fourPipeSystems) { |
| 435 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
|
8 | if (boost::optional<HVACComponent> coolingCoil = fourPipeSystem.coolingCoil()) { |
| 436 |
5/6✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 12 taken 4 times.
✗ Branch 13 not taken.
|
4 | if (coolingCoil->handle() == this->handle()) { |
| 437 |
1/1✓ Branch 1 taken 4 times.
|
4 | return fourPipeSystem; |
| 438 | } | ||
| 439 | 4 | } | |
| 440 | } | ||
| 441 | |||
| 442 | 72 | return boost::none; | |
| 443 | 115 | } | |
| 444 | |||
| 445 | 92 | boost::optional<ZoneHVACComponent> CoilCoolingWater_Impl::containingZoneHVACComponent() const { | |
| 446 | // ZoneHVACFourPipeFanCoil | ||
| 447 |
4/4✓ Branch 1 taken 92 times.
✓ Branch 4 taken 92 times.
✓ Branch 12 taken 2 times.
✓ Branch 13 taken 90 times.
|
92 | for (const auto& zoneHVACFourPipeFanCoil : this->model().getConcreteModelObjects<ZoneHVACFourPipeFanCoil>()) { |
| 448 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
|
4 | if (boost::optional<HVACComponent> coil = zoneHVACFourPipeFanCoil.coolingCoil()) { |
| 449 |
5/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
|
2 | if (coil->handle() == this->handle()) { |
| 450 |
1/1✓ Branch 1 taken 2 times.
|
2 | return zoneHVACFourPipeFanCoil; |
| 451 | } | ||
| 452 | 2 | } | |
| 453 | 92 | } | |
| 454 | |||
| 455 | // ZoneHVACUnitVentilator | ||
| 456 |
3/4✓ Branch 1 taken 90 times.
✓ Branch 4 taken 90 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 90 times.
|
90 | for (const auto& zoneHVACUnitVentilator : this->model().getConcreteModelObjects<ZoneHVACUnitVentilator>()) { |
| 457 | ✗ | if (boost::optional<HVACComponent> coil = zoneHVACUnitVentilator.coolingCoil()) { | |
| 458 | ✗ | if (coil->handle() == this->handle()) { | |
| 459 | ✗ | return zoneHVACUnitVentilator; | |
| 460 | } | ||
| 461 | ✗ | } | |
| 462 | 90 | } | |
| 463 | 90 | return boost::none; | |
| 464 | } | ||
| 465 | |||
| 466 | ✗ | AirflowNetworkEquivalentDuct CoilCoolingWater_Impl::getAirflowNetworkEquivalentDuct(double length, double diameter) { | |
| 467 | ✗ | boost::optional<AirflowNetworkEquivalentDuct> opt = airflowNetworkEquivalentDuct(); | |
| 468 | ✗ | if (opt) { | |
| 469 | ✗ | if (opt->airPathLength() != length) { | |
| 470 | ✗ | opt->setAirPathLength(length); | |
| 471 | } | ||
| 472 | ✗ | if (opt->airPathHydraulicDiameter() != diameter) { | |
| 473 | ✗ | opt->setAirPathHydraulicDiameter(diameter); | |
| 474 | } | ||
| 475 | ✗ | return opt.get(); | |
| 476 | } | ||
| 477 | ✗ | return AirflowNetworkEquivalentDuct(model(), length, diameter, handle()); | |
| 478 | ✗ | } | |
| 479 | |||
| 480 | ✗ | boost::optional<AirflowNetworkEquivalentDuct> CoilCoolingWater_Impl::airflowNetworkEquivalentDuct() const { | |
| 481 | std::vector<AirflowNetworkEquivalentDuct> myAFN = | ||
| 482 | ✗ | getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType()); | |
| 483 | ✗ | auto count = myAFN.size(); | |
| 484 | ✗ | if (count == 1) { | |
| 485 | ✗ | return myAFN[0]; | |
| 486 | ✗ | } else if (count > 1) { | |
| 487 | ✗ | LOG(Warn, briefDescription() << " has more than one AirflowNetwork EquivalentDuct attached, returning first."); | |
| 488 | ✗ | return myAFN[0]; | |
| 489 | } | ||
| 490 | ✗ | return boost::none; | |
| 491 | ✗ | } | |
| 492 | |||
| 493 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignWaterFlowRate() const { | |
| 494 | ✗ | return getAutosizedValue("Design Size Design Water Flow Rate", "m3/s"); | |
| 495 | } | ||
| 496 | |||
| 497 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignAirFlowRate() const { | |
| 498 | ✗ | return getAutosizedValue("Design Size Design Air Flow Rate", "m3/s"); | |
| 499 | } | ||
| 500 | |||
| 501 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignInletWaterTemperature() const { | |
| 502 | ✗ | return getAutosizedValue("Design Size Design Inlet Water Temperature", "C"); | |
| 503 | } | ||
| 504 | |||
| 505 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignInletAirTemperature() const { | |
| 506 | ✗ | return getAutosizedValue("Design Size Design Inlet Air Temperature", "C"); | |
| 507 | } | ||
| 508 | |||
| 509 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignOutletAirTemperature() const { | |
| 510 | ✗ | return getAutosizedValue("Design Size Design Outlet Air Temperature", "C"); | |
| 511 | } | ||
| 512 | |||
| 513 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignInletAirHumidityRatio() const { | |
| 514 | ✗ | return getAutosizedValue("Design Size Design Inlet Air Humidity Ratio", "kgWater/kgDryAir"); | |
| 515 | } | ||
| 516 | |||
| 517 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignOutletAirHumidityRatio() const { | |
| 518 | ✗ | return getAutosizedValue("Design Size Design Outlet Air Humidity Ratio", "kgWater/kgDryAir"); | |
| 519 | } | ||
| 520 | |||
| 521 | ✗ | boost::optional<double> CoilCoolingWater_Impl::autosizedDesignCoilLoad() const { | |
| 522 | // EPLUS-SQL-INCONSISTENCY (?) | ||
| 523 | ✗ | return getAutosizedValueFromInitializationSummary("Design Size Design Coil Load", "W"); | |
| 524 | } | ||
| 525 | |||
| 526 | ✗ | void CoilCoolingWater_Impl::autosize() { | |
| 527 | ✗ | autosizeDesignWaterFlowRate(); | |
| 528 | ✗ | autosizeDesignAirFlowRate(); | |
| 529 | ✗ | autosizeDesignInletWaterTemperature(); | |
| 530 | ✗ | autosizeDesignInletAirTemperature(); | |
| 531 | ✗ | autosizeDesignOutletAirTemperature(); | |
| 532 | ✗ | autosizeDesignInletAirHumidityRatio(); | |
| 533 | ✗ | autosizeDesignOutletAirHumidityRatio(); | |
| 534 | ✗ | } | |
| 535 | |||
| 536 | ✗ | void CoilCoolingWater_Impl::applySizingValues() { | |
| 537 | ✗ | boost::optional<double> val; | |
| 538 | ✗ | val = autosizedDesignWaterFlowRate(); | |
| 539 | ✗ | if (val) { | |
| 540 | ✗ | setDesignWaterFlowRate(val.get()); | |
| 541 | } | ||
| 542 | |||
| 543 | ✗ | val = autosizedDesignAirFlowRate(); | |
| 544 | ✗ | if (val) { | |
| 545 | ✗ | setDesignAirFlowRate(val.get()); | |
| 546 | } | ||
| 547 | |||
| 548 | ✗ | val = autosizedDesignInletWaterTemperature(); | |
| 549 | ✗ | if (val) { | |
| 550 | ✗ | setDesignInletWaterTemperature(val.get()); | |
| 551 | } | ||
| 552 | |||
| 553 | ✗ | val = autosizedDesignInletAirTemperature(); | |
| 554 | ✗ | if (val) { | |
| 555 | ✗ | setDesignInletAirTemperature(val.get()); | |
| 556 | } | ||
| 557 | |||
| 558 | ✗ | val = autosizedDesignOutletAirTemperature(); | |
| 559 | ✗ | if (val) { | |
| 560 | ✗ | setDesignOutletAirTemperature(val.get()); | |
| 561 | } | ||
| 562 | |||
| 563 | ✗ | val = autosizedDesignInletAirHumidityRatio(); | |
| 564 | ✗ | if (val) { | |
| 565 | ✗ | setDesignInletAirHumidityRatio(val.get()); | |
| 566 | } | ||
| 567 | |||
| 568 | ✗ | val = autosizedDesignOutletAirHumidityRatio(); | |
| 569 | ✗ | if (val) { | |
| 570 | ✗ | setDesignOutletAirHumidityRatio(val.get()); | |
| 571 | } | ||
| 572 | ✗ | } | |
| 573 | |||
| 574 | ✗ | ComponentType CoilCoolingWater_Impl::componentType() const { | |
| 575 | ✗ | return ComponentType::Cooling; | |
| 576 | } | ||
| 577 | |||
| 578 | 2 | std::vector<FuelType> CoilCoolingWater_Impl::coolingFuelTypes() const { | |
| 579 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
|
4 | if (auto p_ = plantLoop()) { |
| 580 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return p_->coolingFuelTypes(); |
| 581 | 2 | } | |
| 582 | 1 | return {}; | |
| 583 | } | ||
| 584 | |||
| 585 | ✗ | std::vector<FuelType> CoilCoolingWater_Impl::heatingFuelTypes() const { | |
| 586 | ✗ | return {}; | |
| 587 | } | ||
| 588 | |||
| 589 | ✗ | std::vector<AppGFuelType> CoilCoolingWater_Impl::appGHeatingFuelTypes() const { | |
| 590 | ✗ | return {}; | |
| 591 | } | ||
| 592 | |||
| 593 | } // namespace detail | ||
| 594 | |||
| 595 | 29 | CoilCoolingWater::CoilCoolingWater(const Model& model, Schedule& availableSchedule) | |
| 596 | 29 | : WaterToAirComponent(CoilCoolingWater::iddObjectType(), model) { | |
| 597 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 29 times.
✗ Branch 5 not taken.
|
29 | OS_ASSERT(getImpl<detail::CoilCoolingWater_Impl>()); |
| 598 | |||
| 599 |
1/1✓ Branch 1 taken 29 times.
|
29 | setAvailableSchedule(availableSchedule); |
| 600 | 29 | } | |
| 601 | |||
| 602 | 52 | CoilCoolingWater::CoilCoolingWater(const Model& model) : WaterToAirComponent(CoilCoolingWater::iddObjectType(), model) { | |
| 603 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 52 times.
✗ Branch 5 not taken.
|
52 | OS_ASSERT(getImpl<detail::CoilCoolingWater_Impl>()); |
| 604 | |||
| 605 |
1/1✓ Branch 1 taken 52 times.
|
52 | auto schedule = model.alwaysOnDiscreteSchedule(); |
| 606 |
1/1✓ Branch 1 taken 52 times.
|
52 | setAvailableSchedule(schedule); |
| 607 | 52 | } | |
| 608 | |||
| 609 |
1/1✓ Branch 3 taken 90 times.
|
90 | CoilCoolingWater::CoilCoolingWater(std::shared_ptr<detail::CoilCoolingWater_Impl> p) : WaterToAirComponent(std::move(p)) {} |
| 610 | |||
| 611 | ✗ | Schedule CoilCoolingWater::availabilitySchedule() const { | |
| 612 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->availabilitySchedule(); | |
| 613 | } | ||
| 614 | |||
| 615 | 13 | Schedule CoilCoolingWater::availableSchedule() const { | |
| 616 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->availabilitySchedule(); |
| 617 | } | ||
| 618 | |||
| 619 | ✗ | bool CoilCoolingWater::setAvailabilitySchedule(Schedule& schedule) { | |
| 620 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->setAvailabilitySchedule(schedule); | |
| 621 | } | ||
| 622 | |||
| 623 | 81 | bool CoilCoolingWater::setAvailableSchedule(Schedule& schedule) { | |
| 624 |
1/1✓ Branch 3 taken 81 times.
|
81 | return getImpl<detail::CoilCoolingWater_Impl>()->setAvailabilitySchedule(schedule); |
| 625 | } | ||
| 626 | |||
| 627 | 5 | boost::optional<double> CoilCoolingWater::designWaterFlowRate() { | |
| 628 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CoilCoolingWater_Impl>()->designWaterFlowRate(); |
| 629 | } | ||
| 630 | |||
| 631 | 5 | bool CoilCoolingWater::setDesignWaterFlowRate(double value) { | |
| 632 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CoilCoolingWater_Impl>()->setDesignWaterFlowRate(value); |
| 633 | } | ||
| 634 | |||
| 635 | 13 | bool CoilCoolingWater::isDesignWaterFlowRateAutosized() { | |
| 636 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->isDesignWaterFlowRateAutosized(); |
| 637 | } | ||
| 638 | |||
| 639 | ✗ | void CoilCoolingWater::autosizeDesignWaterFlowRate() { | |
| 640 | ✗ | getImpl<detail::CoilCoolingWater_Impl>()->autosizeDesignWaterFlowRate(); | |
| 641 | ✗ | } | |
| 642 | |||
| 643 | ✗ | boost::optional<double> CoilCoolingWater::designAirFlowRate() { | |
| 644 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->designAirFlowRate(); | |
| 645 | } | ||
| 646 | |||
| 647 | 5 | bool CoilCoolingWater::setDesignAirFlowRate(double value) { | |
| 648 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CoilCoolingWater_Impl>()->setDesignAirFlowRate(value); |
| 649 | } | ||
| 650 | |||
| 651 | 13 | bool CoilCoolingWater::isDesignAirFlowRateAutosized() { | |
| 652 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->isDesignAirFlowRateAutosized(); |
| 653 | } | ||
| 654 | |||
| 655 | ✗ | void CoilCoolingWater::autosizeDesignAirFlowRate() { | |
| 656 | ✗ | getImpl<detail::CoilCoolingWater_Impl>()->autosizeDesignAirFlowRate(); | |
| 657 | ✗ | } | |
| 658 | |||
| 659 | ✗ | boost::optional<double> CoilCoolingWater::designInletWaterTemperature() { | |
| 660 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->designInletWaterTemperature(); | |
| 661 | } | ||
| 662 | |||
| 663 | 10 | bool CoilCoolingWater::setDesignInletWaterTemperature(double value) { | |
| 664 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::CoilCoolingWater_Impl>()->setDesignInletWaterTemperature(value); |
| 665 | } | ||
| 666 | |||
| 667 | 13 | bool CoilCoolingWater::isDesignInletWaterTemperatureAutosized() { | |
| 668 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->isDesignInletWaterTemperatureAutosized(); |
| 669 | } | ||
| 670 | |||
| 671 | ✗ | void CoilCoolingWater::autosizeDesignInletWaterTemperature() { | |
| 672 | ✗ | getImpl<detail::CoilCoolingWater_Impl>()->autosizeDesignInletWaterTemperature(); | |
| 673 | ✗ | } | |
| 674 | |||
| 675 | ✗ | boost::optional<double> CoilCoolingWater::designInletAirTemperature() { | |
| 676 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->designInletAirTemperature(); | |
| 677 | } | ||
| 678 | |||
| 679 | ✗ | bool CoilCoolingWater::setDesignInletAirTemperature(double value) { | |
| 680 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->setDesignInletAirTemperature(value); | |
| 681 | } | ||
| 682 | |||
| 683 | 13 | bool CoilCoolingWater::isDesignInletAirTemperatureAutosized() { | |
| 684 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->isDesignInletAirTemperatureAutosized(); |
| 685 | } | ||
| 686 | |||
| 687 | 5 | void CoilCoolingWater::autosizeDesignInletAirTemperature() { | |
| 688 |
1/1✓ Branch 3 taken 5 times.
|
5 | getImpl<detail::CoilCoolingWater_Impl>()->autosizeDesignInletAirTemperature(); |
| 689 | 5 | } | |
| 690 | |||
| 691 | ✗ | boost::optional<double> CoilCoolingWater::designOutletAirTemperature() { | |
| 692 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->designOutletAirTemperature(); | |
| 693 | } | ||
| 694 | |||
| 695 | ✗ | bool CoilCoolingWater::setDesignOutletAirTemperature(double value) { | |
| 696 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->setDesignOutletAirTemperature(value); | |
| 697 | } | ||
| 698 | |||
| 699 | 13 | bool CoilCoolingWater::isDesignOutletAirTemperatureAutosized() { | |
| 700 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->isDesignOutletAirTemperatureAutosized(); |
| 701 | } | ||
| 702 | |||
| 703 | 5 | void CoilCoolingWater::autosizeDesignOutletAirTemperature() { | |
| 704 |
1/1✓ Branch 3 taken 5 times.
|
5 | getImpl<detail::CoilCoolingWater_Impl>()->autosizeDesignOutletAirTemperature(); |
| 705 | 5 | } | |
| 706 | |||
| 707 | ✗ | boost::optional<double> CoilCoolingWater::designInletAirHumidityRatio() { | |
| 708 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->designInletAirHumidityRatio(); | |
| 709 | } | ||
| 710 | |||
| 711 | ✗ | bool CoilCoolingWater::setDesignInletAirHumidityRatio(double value) { | |
| 712 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->setDesignInletAirHumidityRatio(value); | |
| 713 | } | ||
| 714 | |||
| 715 | 13 | bool CoilCoolingWater::isDesignInletAirHumidityRatioAutosized() { | |
| 716 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->isDesignInletAirHumidityRatioAutosized(); |
| 717 | } | ||
| 718 | |||
| 719 | 5 | void CoilCoolingWater::autosizeDesignInletAirHumidityRatio() { | |
| 720 |
1/1✓ Branch 3 taken 5 times.
|
5 | getImpl<detail::CoilCoolingWater_Impl>()->autosizeDesignInletAirHumidityRatio(); |
| 721 | 5 | } | |
| 722 | |||
| 723 | ✗ | boost::optional<double> CoilCoolingWater::designOutletAirHumidityRatio() { | |
| 724 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->designOutletAirHumidityRatio(); | |
| 725 | } | ||
| 726 | |||
| 727 | ✗ | bool CoilCoolingWater::setDesignOutletAirHumidityRatio(double value) { | |
| 728 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->setDesignOutletAirHumidityRatio(value); | |
| 729 | } | ||
| 730 | |||
| 731 | 13 | bool CoilCoolingWater::isDesignOutletAirHumidityRatioAutosized() { | |
| 732 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->isDesignOutletAirHumidityRatioAutosized(); |
| 733 | } | ||
| 734 | |||
| 735 | 5 | void CoilCoolingWater::autosizeDesignOutletAirHumidityRatio() { | |
| 736 |
1/1✓ Branch 3 taken 5 times.
|
5 | getImpl<detail::CoilCoolingWater_Impl>()->autosizeDesignOutletAirHumidityRatio(); |
| 737 | 5 | } | |
| 738 | |||
| 739 | 13 | std::string CoilCoolingWater::typeOfAnalysis() { | |
| 740 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->typeOfAnalysis(); |
| 741 | } | ||
| 742 | |||
| 743 | 5 | bool CoilCoolingWater::setTypeOfAnalysis(const std::string& value) { | |
| 744 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CoilCoolingWater_Impl>()->setTypeOfAnalysis(value); |
| 745 | } | ||
| 746 | |||
| 747 | 13 | std::string CoilCoolingWater::heatExchangerConfiguration() { | |
| 748 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::CoilCoolingWater_Impl>()->heatExchangerConfiguration(); |
| 749 | } | ||
| 750 | |||
| 751 | ✗ | bool CoilCoolingWater::setHeatExchangerConfiguration(const std::string& value) { | |
| 752 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->setHeatExchangerConfiguration(value); | |
| 753 | } | ||
| 754 | |||
| 755 | 8711 | IddObjectType CoilCoolingWater::iddObjectType() { | |
| 756 |
1/1✓ Branch 1 taken 8711 times.
|
8711 | IddObjectType result(IddObjectType::OS_Coil_Cooling_Water); |
| 757 | 8711 | return result; | |
| 758 | } | ||
| 759 | |||
| 760 | 29 | boost::optional<ControllerWaterCoil> CoilCoolingWater::controllerWaterCoil() { | |
| 761 |
1/1✓ Branch 3 taken 29 times.
|
29 | return getImpl<detail::CoilCoolingWater_Impl>()->controllerWaterCoil(); |
| 762 | } | ||
| 763 | |||
| 764 | ✗ | AirflowNetworkEquivalentDuct CoilCoolingWater::getAirflowNetworkEquivalentDuct(double length, double diameter) { | |
| 765 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->getAirflowNetworkEquivalentDuct(length, diameter); | |
| 766 | } | ||
| 767 | |||
| 768 | ✗ | boost::optional<AirflowNetworkEquivalentDuct> CoilCoolingWater::airflowNetworkEquivalentDuct() const { | |
| 769 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->airflowNetworkEquivalentDuct(); | |
| 770 | } | ||
| 771 | |||
| 772 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignWaterFlowRate() const { | |
| 773 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignWaterFlowRate(); | |
| 774 | } | ||
| 775 | |||
| 776 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignAirFlowRate() const { | |
| 777 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignAirFlowRate(); | |
| 778 | } | ||
| 779 | |||
| 780 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignInletWaterTemperature() const { | |
| 781 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignInletWaterTemperature(); | |
| 782 | } | ||
| 783 | |||
| 784 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignInletAirTemperature() const { | |
| 785 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignInletAirTemperature(); | |
| 786 | } | ||
| 787 | |||
| 788 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignOutletAirTemperature() const { | |
| 789 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignOutletAirTemperature(); | |
| 790 | } | ||
| 791 | |||
| 792 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignInletAirHumidityRatio() const { | |
| 793 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignInletAirHumidityRatio(); | |
| 794 | } | ||
| 795 | |||
| 796 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignOutletAirHumidityRatio() const { | |
| 797 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignOutletAirHumidityRatio(); | |
| 798 | } | ||
| 799 | |||
| 800 | ✗ | boost::optional<double> CoilCoolingWater::autosizedDesignCoilLoad() const { | |
| 801 | ✗ | return getImpl<detail::CoilCoolingWater_Impl>()->autosizedDesignCoilLoad(); | |
| 802 | } | ||
| 803 | |||
| 804 | } // namespace model | ||
| 805 | } // namespace openstudio | ||
| 806 |