src/model/SolarCollectorFlatPlatePhotovoltaicThermal.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 "SolarCollectorFlatPlatePhotovoltaicThermal.hpp" | ||
| 7 | #include "SolarCollectorFlatPlatePhotovoltaicThermal_Impl.hpp" | ||
| 8 | |||
| 9 | #include "PlanarSurface.hpp" | ||
| 10 | #include "PlanarSurface_Impl.hpp" | ||
| 11 | #include "Surface.hpp" | ||
| 12 | #include "Surface_Impl.hpp" | ||
| 13 | #include "ShadingSurface.hpp" | ||
| 14 | #include "ShadingSurface_Impl.hpp" | ||
| 15 | #include "SolarCollectorPerformancePhotovoltaicThermalBIPVT.hpp" | ||
| 16 | #include "SolarCollectorPerformancePhotovoltaicThermalBIPVT_Impl.hpp" | ||
| 17 | #include "SolarCollectorPerformancePhotovoltaicThermalSimple.hpp" | ||
| 18 | #include "SolarCollectorPerformancePhotovoltaicThermalSimple_Impl.hpp" | ||
| 19 | #include "Node.hpp" | ||
| 20 | #include "Node_Impl.hpp" | ||
| 21 | #include "GeneratorPhotovoltaic.hpp" | ||
| 22 | #include "GeneratorPhotovoltaic_Impl.hpp" | ||
| 23 | #include "Model.hpp" | ||
| 24 | #include "AirLoopHVACOutdoorAirSystem.hpp" | ||
| 25 | |||
| 26 | #include "../utilities/core/Assert.hpp" | ||
| 27 | #include "../utilities/data/DataEnums.hpp" | ||
| 28 | |||
| 29 | #include <utilities/idd/OS_SolarCollector_FlatPlate_PhotovoltaicThermal_FieldEnums.hxx> | ||
| 30 | #include <utilities/idd/IddEnums.hxx> | ||
| 31 | |||
| 32 | namespace openstudio { | ||
| 33 | namespace model { | ||
| 34 | |||
| 35 | namespace detail { | ||
| 36 | |||
| 37 | 13 | SolarCollectorFlatPlatePhotovoltaicThermal_Impl::SolarCollectorFlatPlatePhotovoltaicThermal_Impl(const IdfObject& idfObject, Model_Impl* model, | |
| 38 | 13 | bool keepHandle) | |
| 39 | 13 | : StraightComponent_Impl(idfObject, model, keepHandle) { | |
| 40 |
4/6✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 13 times.
✗ Branch 13 not taken.
|
13 | OS_ASSERT(idfObject.iddObject().type() == SolarCollectorFlatPlatePhotovoltaicThermal::iddObjectType()); |
| 41 | 13 | } | |
| 42 | |||
| 43 | ✗ | SolarCollectorFlatPlatePhotovoltaicThermal_Impl::SolarCollectorFlatPlatePhotovoltaicThermal_Impl( | |
| 44 | ✗ | const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 45 | ✗ | : StraightComponent_Impl(other, model, keepHandle) { | |
| 46 | ✗ | OS_ASSERT(other.iddObject().type() == SolarCollectorFlatPlatePhotovoltaicThermal::iddObjectType()); | |
| 47 | ✗ | } | |
| 48 | |||
| 49 | 6 | SolarCollectorFlatPlatePhotovoltaicThermal_Impl::SolarCollectorFlatPlatePhotovoltaicThermal_Impl( | |
| 50 | 6 | const SolarCollectorFlatPlatePhotovoltaicThermal_Impl& other, Model_Impl* model, bool keepHandle) | |
| 51 | 6 | : StraightComponent_Impl(other, model, keepHandle) {} | |
| 52 | |||
| 53 | 2 | ModelObject SolarCollectorFlatPlatePhotovoltaicThermal_Impl::clone(Model model) const { | |
| 54 | |||
| 55 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | auto result = StraightComponent_Impl::clone(model).cast<SolarCollectorFlatPlatePhotovoltaicThermal>(); |
| 56 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | auto newPerformance = this->solarCollectorPerformance().clone(model).cast<SolarCollectorPerformancePhotovoltaicThermalSimple>(); |
| 57 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | result.setPointer(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::PhotovoltaicThermalModelPerformanceName, newPerformance.handle()); |
| 58 | |||
| 59 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<GeneratorPhotovoltaic> pv = this->generatorPhotovoltaic(); |
| 60 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (pv) { |
| 61 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | auto newPV = pv->clone(model).cast<GeneratorPhotovoltaic>(); |
| 62 |
1/1✓ Branch 1 taken 2 times.
|
2 | result.setGeneratorPhotovoltaic(newPV); |
| 63 | 2 | } | |
| 64 | |||
| 65 | // do not want to point to any surface after cloning | ||
| 66 |
1/1✓ Branch 1 taken 2 times.
|
2 | result.resetSurface(); |
| 67 | |||
| 68 | 4 | return std::move(result); | |
| 69 | 2 | } | |
| 70 | |||
| 71 | 2 | std::vector<IdfObject> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::remove() { | |
| 72 | // DLM: will remove performance object due to parent/child relationship | ||
| 73 | 2 | return StraightComponent_Impl::remove(); | |
| 74 | } | ||
| 75 | |||
| 76 | ✗ | const std::vector<std::string>& SolarCollectorFlatPlatePhotovoltaicThermal_Impl::outputVariableNames() const { | |
| 77 | static const std::vector<std::string> result{"Generator Produced Thermal Rate", "Generator Produced Thermal Energy", | ||
| 78 | "Generator PVT Fluid Bypass Status", "Generator PVT Fluid Inlet Temperature", | ||
| 79 | ✗ | "Generator PVT Fluid Outlet Temperature", "Generator PVT Fluid Mass Flow Rate"}; | |
| 80 | ✗ | return result; | |
| 81 | ✗ | } | |
| 82 | |||
| 83 | 3 | IddObjectType SolarCollectorFlatPlatePhotovoltaicThermal_Impl::iddObjectType() const { | |
| 84 | 3 | return SolarCollectorFlatPlatePhotovoltaicThermal::iddObjectType(); | |
| 85 | } | ||
| 86 | |||
| 87 | 4 | std::vector<ModelObject> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::children() const { | |
| 88 | 4 | std::vector<ModelObject> result; | |
| 89 | |||
| 90 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | result.push_back(this->solarCollectorPerformance()); |
| 91 | |||
| 92 | 4 | return result; | |
| 93 | ✗ | } | |
| 94 | |||
| 95 | 10 | unsigned SolarCollectorFlatPlatePhotovoltaicThermal_Impl::inletPort() const { | |
| 96 | 10 | return OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::InletNodeName; | |
| 97 | } | ||
| 98 | |||
| 99 | 37 | unsigned SolarCollectorFlatPlatePhotovoltaicThermal_Impl::outletPort() const { | |
| 100 | 37 | return OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::OutletNodeName; | |
| 101 | } | ||
| 102 | |||
| 103 | 3 | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::addToNode(Node& node) { | |
| 104 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (boost::optional<PlantLoop> plantLoop = node.plantLoop()) { |
| 105 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
|
6 | if (plantLoop->supplyComponent(node.handle())) { |
| 106 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | if (StraightComponent_Impl::addToNode(node)) { |
| 107 | 3 | return true; | |
| 108 | } | ||
| 109 | } | ||
| 110 | ✗ | } else if (boost::optional<AirLoopHVAC> airLoopHVAC = node.airLoopHVAC()) { | |
| 111 | ✗ | boost::optional<AirLoopHVACOutdoorAirSystem> oa = airLoopHVAC->airLoopHVACOutdoorAirSystem(); | |
| 112 | ✗ | if (oa) { | |
| 113 | ✗ | if (oa->oaComponent(node.handle())) { | |
| 114 | ✗ | if (StraightComponent_Impl::addToNode(node)) { | |
| 115 | ✗ | return true; | |
| 116 | } | ||
| 117 | } | ||
| 118 | } | ||
| 119 | 3 | } | |
| 120 | |||
| 121 | ✗ | return false; | |
| 122 | } | ||
| 123 | |||
| 124 | 29 | ModelObject SolarCollectorFlatPlatePhotovoltaicThermal_Impl::solarCollectorPerformance() const { | |
| 125 |
1/1✓ Branch 1 taken 29 times.
|
58 | boost::optional<ModelObject> value = getObject<ModelObject>().getModelObjectTarget<ModelObject>( |
| 126 |
1/1✓ Branch 1 taken 29 times.
|
29 | OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::PhotovoltaicThermalModelPerformanceName); |
| 127 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
|
29 | if (!value) { |
| 128 | // DLM: could default construct one here? | ||
| 129 | ✗ | LOG_AND_THROW(briefDescription() << " does not have an Solar Collector Performance attached."); | |
| 130 | } | ||
| 131 |
2/2✓ Branch 1 taken 29 times.
✓ Branch 4 taken 29 times.
|
58 | return value.get(); |
| 132 | 29 | } | |
| 133 | |||
| 134 | 7 | boost::optional<PlanarSurface> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::surface() const { | |
| 135 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | return getObject<ModelObject>().getModelObjectTarget<PlanarSurface>(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::SurfaceName); |
| 136 | } | ||
| 137 | |||
| 138 | 8 | boost::optional<GeneratorPhotovoltaic> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::generatorPhotovoltaic() const { | |
| 139 |
1/1✓ Branch 1 taken 8 times.
|
16 | return getObject<ModelObject>().getModelObjectTarget<GeneratorPhotovoltaic>( |
| 140 |
1/1✓ Branch 1 taken 8 times.
|
16 | OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::PhotovoltaicName); |
| 141 | } | ||
| 142 | |||
| 143 | 2 | boost::optional<double> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::designFlowRate() const { | |
| 144 | 2 | return getDouble(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::DesignFlowRate, true); | |
| 145 | } | ||
| 146 | |||
| 147 | ✗ | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::isDesignFlowRateAutosized() const { | |
| 148 | ✗ | bool result = false; | |
| 149 | ✗ | boost::optional<std::string> value = getString(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::DesignFlowRate, true); | |
| 150 | ✗ | if (value) { | |
| 151 | ✗ | result = openstudio::istringEqual(value.get(), "autosize"); | |
| 152 | } | ||
| 153 | ✗ | return result; | |
| 154 | ✗ | } | |
| 155 | |||
| 156 | ✗ | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::setSolarCollectorPerformance( | |
| 157 | const SolarCollectorPerformancePhotovoltaicThermalBIPVT& performance) { | ||
| 158 | ✗ | bool result(false); | |
| 159 | ✗ | auto current = this->solarCollectorPerformance(); | |
| 160 | ✗ | if (current.handle() == performance.handle()) { | |
| 161 | ✗ | return true; // no-op | |
| 162 | } | ||
| 163 | ✗ | ModelObject clone = performance.clone(this->model()); | |
| 164 | ✗ | result = setSolarCollectorPerformanceNoClone(clone); | |
| 165 | ✗ | if (result) { | |
| 166 | ✗ | current.remove(); | |
| 167 | } else { | ||
| 168 | ✗ | result = setSolarCollectorPerformanceNoClone(current); | |
| 169 | ✗ | OS_ASSERT(result); | |
| 170 | ✗ | return false; | |
| 171 | } | ||
| 172 | ✗ | return result; | |
| 173 | ✗ | } | |
| 174 | |||
| 175 | 2 | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::setSolarCollectorPerformance( | |
| 176 | const SolarCollectorPerformancePhotovoltaicThermalSimple& performance) { | ||
| 177 | 2 | bool result(false); | |
| 178 |
1/1✓ Branch 1 taken 2 times.
|
2 | auto current = this->solarCollectorPerformance(); |
| 179 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 9 taken 1 time.
✓ Branch 10 taken 1 time.
|
2 | if (current.handle() == performance.handle()) { |
| 180 | 1 | return true; // no-op | |
| 181 | } | ||
| 182 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | ModelObject clone = performance.clone(this->model()); |
| 183 |
1/1✓ Branch 1 taken 1 time.
|
1 | result = setSolarCollectorPerformanceNoClone(clone); |
| 184 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (result) { |
| 185 |
1/1✓ Branch 1 taken 1 time.
|
1 | current.remove(); |
| 186 | } else { | ||
| 187 | ✗ | result = setSolarCollectorPerformanceNoClone(current); | |
| 188 | ✗ | OS_ASSERT(result); | |
| 189 | ✗ | return false; | |
| 190 | } | ||
| 191 | 1 | return result; | |
| 192 | 2 | } | |
| 193 | |||
| 194 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal_Impl::resetSolarCollectorPerformance() { | |
| 195 | boost::optional<SolarCollectorPerformancePhotovoltaicThermalSimple> oldPerformance = | ||
| 196 | ✗ | getObject<ModelObject>().getModelObjectTarget<SolarCollectorPerformancePhotovoltaicThermalSimple>( | |
| 197 | ✗ | OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::PhotovoltaicThermalModelPerformanceName); | |
| 198 | ✗ | if (oldPerformance) { | |
| 199 | ✗ | oldPerformance->remove(); | |
| 200 | } | ||
| 201 | |||
| 202 | ✗ | SolarCollectorPerformancePhotovoltaicThermalSimple performance(this->model()); | |
| 203 | ✗ | bool ok = setSolarCollectorPerformanceNoClone(performance); | |
| 204 | ✗ | OS_ASSERT(ok); | |
| 205 | ✗ | } | |
| 206 | |||
| 207 | 4 | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::setSurface(const PlanarSurface& surface) { | |
| 208 | 4 | bool result(false); | |
| 209 | |||
| 210 | // DLM: check for existing solar collectors or photovoltaic generators? | ||
| 211 | |||
| 212 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 3 times.
|
8 | if (surface.optionalCast<Surface>()) { |
| 213 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result = setPointer(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::SurfaceName, surface.handle()); |
| 214 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
|
6 | } else if (surface.optionalCast<ShadingSurface>()) { |
| 215 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | result = setPointer(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::SurfaceName, surface.handle()); |
| 216 | } | ||
| 217 | |||
| 218 | 4 | return result; | |
| 219 | } | ||
| 220 | |||
| 221 | 2 | void SolarCollectorFlatPlatePhotovoltaicThermal_Impl::resetSurface() { | |
| 222 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | bool result = setString(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::SurfaceName, ""); |
| 223 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 224 | 2 | } | |
| 225 | |||
| 226 | 6 | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::setGeneratorPhotovoltaic(const GeneratorPhotovoltaic& generatorPhotovoltaic) { | |
| 227 | // DLM: should we check that these reference the same surface? | ||
| 228 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | return setPointer(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::PhotovoltaicName, generatorPhotovoltaic.handle()); |
| 229 | } | ||
| 230 | |||
| 231 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal_Impl::resetGeneratorPhotovoltaic() { | |
| 232 | ✗ | bool result = setString(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::PhotovoltaicName, ""); | |
| 233 | ✗ | OS_ASSERT(result); | |
| 234 | ✗ | } | |
| 235 | |||
| 236 | ✗ | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::setDesignFlowRate(double designFlowRate) { | |
| 237 | ✗ | return setDouble(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::DesignFlowRate, designFlowRate); | |
| 238 | } | ||
| 239 | |||
| 240 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal_Impl::resetDesignFlowRate() { | |
| 241 | ✗ | bool result = setString(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::DesignFlowRate, ""); | |
| 242 | ✗ | OS_ASSERT(result); | |
| 243 | ✗ | } | |
| 244 | |||
| 245 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal_Impl::autosizeDesignFlowRate() { | |
| 246 | ✗ | bool result = setString(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::DesignFlowRate, "autosize"); | |
| 247 | ✗ | OS_ASSERT(result); | |
| 248 | ✗ | } | |
| 249 | |||
| 250 | 14 | bool SolarCollectorFlatPlatePhotovoltaicThermal_Impl::setSolarCollectorPerformanceNoClone(const ModelObject& performance) { | |
| 251 |
2/2✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
|
14 | return setPointer(OS_SolarCollector_FlatPlate_PhotovoltaicThermalFields::PhotovoltaicThermalModelPerformanceName, performance.handle()); |
| 252 | } | ||
| 253 | |||
| 254 | ✗ | boost::optional<double> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::autosizedDesignFlowRate() const { | |
| 255 | ✗ | return getAutosizedValue("Design Size Design Flow Rate", "m3/s"); | |
| 256 | } | ||
| 257 | |||
| 258 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal_Impl::autosize() { | |
| 259 | ✗ | autosizeDesignFlowRate(); | |
| 260 | ✗ | } | |
| 261 | |||
| 262 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal_Impl::applySizingValues() { | |
| 263 | ✗ | boost::optional<double> val; | |
| 264 | ✗ | val = autosizedDesignFlowRate(); | |
| 265 | ✗ | if (val) { | |
| 266 | ✗ | setDesignFlowRate(val.get()); | |
| 267 | } | ||
| 268 | ✗ | } | |
| 269 | |||
| 270 | 7 | ComponentType SolarCollectorFlatPlatePhotovoltaicThermal_Impl::componentType() const { | |
| 271 |
1/1✓ Branch 1 taken 7 times.
|
7 | return ComponentType::Heating; |
| 272 | } | ||
| 273 | |||
| 274 | ✗ | std::vector<FuelType> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::coolingFuelTypes() const { | |
| 275 | ✗ | return {}; | |
| 276 | } | ||
| 277 | |||
| 278 | ✗ | std::vector<FuelType> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::heatingFuelTypes() const { | |
| 279 | ✗ | return {FuelType::Solar}; | |
| 280 | } | ||
| 281 | |||
| 282 | ✗ | std::vector<AppGFuelType> SolarCollectorFlatPlatePhotovoltaicThermal_Impl::appGHeatingFuelTypes() const { | |
| 283 | ✗ | return {AppGFuelType::Solar}; | |
| 284 | } | ||
| 285 | |||
| 286 | } // namespace detail | ||
| 287 | |||
| 288 | 10 | SolarCollectorFlatPlatePhotovoltaicThermal::SolarCollectorFlatPlatePhotovoltaicThermal(const Model& model) | |
| 289 | 10 | : StraightComponent(SolarCollectorFlatPlatePhotovoltaicThermal::iddObjectType(), model) { | |
| 290 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 10 times.
✗ Branch 5 not taken.
|
10 | OS_ASSERT(getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()); |
| 291 | |||
| 292 |
1/1✓ Branch 1 taken 10 times.
|
10 | SolarCollectorPerformancePhotovoltaicThermalSimple performance(model); |
| 293 | |||
| 294 |
1/1✓ Branch 3 taken 10 times.
|
10 | const bool ok = getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setSolarCollectorPerformanceNoClone(performance); |
| 295 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
|
10 | OS_ASSERT(ok); |
| 296 | 10 | } | |
| 297 | |||
| 298 | 2 | SolarCollectorFlatPlatePhotovoltaicThermal::SolarCollectorFlatPlatePhotovoltaicThermal( | |
| 299 | 2 | const SolarCollectorPerformancePhotovoltaicThermalBIPVT& performance) | |
| 300 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | : StraightComponent(SolarCollectorFlatPlatePhotovoltaicThermal::iddObjectType(), performance.model()) { |
| 301 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 5 not taken.
|
2 | OS_ASSERT(getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()); |
| 302 | |||
| 303 |
1/1✓ Branch 3 taken 2 times.
|
2 | const bool ok = getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setSolarCollectorPerformanceNoClone(performance); |
| 304 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 305 | 2 | } | |
| 306 | |||
| 307 | 1 | SolarCollectorFlatPlatePhotovoltaicThermal::SolarCollectorFlatPlatePhotovoltaicThermal( | |
| 308 | 1 | const SolarCollectorPerformancePhotovoltaicThermalSimple& performance) | |
| 309 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | : StraightComponent(SolarCollectorFlatPlatePhotovoltaicThermal::iddObjectType(), performance.model()) { |
| 310 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
|
1 | OS_ASSERT(getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()); |
| 311 | |||
| 312 |
1/1✓ Branch 3 taken 1 time.
|
1 | const bool ok = getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setSolarCollectorPerformanceNoClone(performance); |
| 313 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
|
1 | OS_ASSERT(ok); |
| 314 | 1 | } | |
| 315 | |||
| 316 | 7640 | IddObjectType SolarCollectorFlatPlatePhotovoltaicThermal::iddObjectType() { | |
| 317 |
1/1✓ Branch 1 taken 7640 times.
|
7640 | return {IddObjectType::OS_SolarCollector_FlatPlate_PhotovoltaicThermal}; |
| 318 | } | ||
| 319 | |||
| 320 | 21 | ModelObject SolarCollectorFlatPlatePhotovoltaicThermal::solarCollectorPerformance() const { | |
| 321 |
1/1✓ Branch 3 taken 21 times.
|
21 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->solarCollectorPerformance(); |
| 322 | } | ||
| 323 | |||
| 324 | 7 | boost::optional<PlanarSurface> SolarCollectorFlatPlatePhotovoltaicThermal::surface() const { | |
| 325 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->surface(); |
| 326 | } | ||
| 327 | |||
| 328 | 6 | boost::optional<GeneratorPhotovoltaic> SolarCollectorFlatPlatePhotovoltaicThermal::generatorPhotovoltaic() const { | |
| 329 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->generatorPhotovoltaic(); |
| 330 | } | ||
| 331 | |||
| 332 | 2 | boost::optional<double> SolarCollectorFlatPlatePhotovoltaicThermal::designFlowRate() const { | |
| 333 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->designFlowRate(); |
| 334 | } | ||
| 335 | |||
| 336 | ✗ | bool SolarCollectorFlatPlatePhotovoltaicThermal::isDesignFlowRateAutosized() const { | |
| 337 | ✗ | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->isDesignFlowRateAutosized(); | |
| 338 | } | ||
| 339 | |||
| 340 | 4 | bool SolarCollectorFlatPlatePhotovoltaicThermal::setSurface(const PlanarSurface& surface) { | |
| 341 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setSurface(surface); |
| 342 | } | ||
| 343 | |||
| 344 | 2 | void SolarCollectorFlatPlatePhotovoltaicThermal::resetSurface() { | |
| 345 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->resetSurface(); |
| 346 | } | ||
| 347 | |||
| 348 | 6 | bool SolarCollectorFlatPlatePhotovoltaicThermal::setGeneratorPhotovoltaic(const GeneratorPhotovoltaic& generatorPhotovoltaic) { | |
| 349 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setGeneratorPhotovoltaic(generatorPhotovoltaic); |
| 350 | } | ||
| 351 | |||
| 352 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal::resetGeneratorPhotovoltaic() { | |
| 353 | ✗ | getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->resetGeneratorPhotovoltaic(); | |
| 354 | ✗ | } | |
| 355 | |||
| 356 | bool | ||
| 357 | ✗ | SolarCollectorFlatPlatePhotovoltaicThermal::setSolarCollectorPerformance(const SolarCollectorPerformancePhotovoltaicThermalBIPVT& performance) { | |
| 358 | ✗ | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setSolarCollectorPerformance(performance); | |
| 359 | } | ||
| 360 | |||
| 361 | bool | ||
| 362 | 2 | SolarCollectorFlatPlatePhotovoltaicThermal::setSolarCollectorPerformance(const SolarCollectorPerformancePhotovoltaicThermalSimple& performance) { | |
| 363 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setSolarCollectorPerformance(performance); |
| 364 | } | ||
| 365 | |||
| 366 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal::resetSolarCollectorPerformance() { | |
| 367 | ✗ | getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->resetSolarCollectorPerformance(); | |
| 368 | ✗ | } | |
| 369 | |||
| 370 | ✗ | bool SolarCollectorFlatPlatePhotovoltaicThermal::setDesignFlowRate(double designFlowRate) { | |
| 371 | ✗ | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->setDesignFlowRate(designFlowRate); | |
| 372 | } | ||
| 373 | |||
| 374 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal::resetDesignFlowRate() { | |
| 375 | ✗ | getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->resetDesignFlowRate(); | |
| 376 | ✗ | } | |
| 377 | |||
| 378 | ✗ | void SolarCollectorFlatPlatePhotovoltaicThermal::autosizeDesignFlowRate() { | |
| 379 | ✗ | getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->autosizeDesignFlowRate(); | |
| 380 | ✗ | } | |
| 381 | |||
| 382 | /// @cond | ||
| 383 | 8 | SolarCollectorFlatPlatePhotovoltaicThermal::SolarCollectorFlatPlatePhotovoltaicThermal( | |
| 384 | 8 | std::shared_ptr<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl> impl) | |
| 385 |
1/1✓ Branch 3 taken 8 times.
|
8 | : StraightComponent(std::move(impl)) {} |
| 386 | /// @endcond | ||
| 387 | |||
| 388 | ✗ | boost::optional<double> SolarCollectorFlatPlatePhotovoltaicThermal::autosizedDesignFlowRate() const { | |
| 389 | ✗ | return getImpl<detail::SolarCollectorFlatPlatePhotovoltaicThermal_Impl>()->autosizedDesignFlowRate(); | |
| 390 | } | ||
| 391 | |||
| 392 | } // namespace model | ||
| 393 | } // namespace openstudio | ||
| 394 |