src/model/MaterialPropertyPhaseChange.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 <vector> | ||
| 7 | #include "Material.hpp" | ||
| 8 | #include "Material_Impl.hpp" | ||
| 9 | #include "StandardOpaqueMaterial.hpp" | ||
| 10 | #include "StandardOpaqueMaterial_Impl.hpp" | ||
| 11 | #include "MasslessOpaqueMaterial.hpp" | ||
| 12 | #include "MasslessOpaqueMaterial_Impl.hpp" | ||
| 13 | #include "MaterialPropertyPhaseChange.hpp" | ||
| 14 | #include "MaterialPropertyPhaseChange_Impl.hpp" | ||
| 15 | #include "ModelExtensibleGroup.hpp" | ||
| 16 | #include "Model.hpp" | ||
| 17 | #include "Model_Impl.hpp" | ||
| 18 | |||
| 19 | #include <utilities/idd/IddEnums.hxx> | ||
| 20 | #include <utilities/idd/OS_MaterialProperty_PhaseChange_FieldEnums.hxx> | ||
| 21 | |||
| 22 | #include "../utilities/core/Assert.hpp" | ||
| 23 | |||
| 24 | namespace openstudio { | ||
| 25 | namespace model { | ||
| 26 | |||
| 27 | 57 | TemperatureEnthalpy::TemperatureEnthalpy(double temperature, double enthalpy) : m_temperature(temperature), m_enthalpy(enthalpy) {} | |
| 28 | |||
| 29 | 45 | double TemperatureEnthalpy::temperature() const { | |
| 30 | 45 | return m_temperature; | |
| 31 | } | ||
| 32 | |||
| 33 | 45 | double TemperatureEnthalpy::enthalpy() const { | |
| 34 | 45 | return m_enthalpy; | |
| 35 | } | ||
| 36 | |||
| 37 | ✗ | std::ostream& operator<<(std::ostream& out, const openstudio::model::TemperatureEnthalpy& temperatureEnthalpy) { | |
| 38 | ✗ | out << "temperature=" << temperatureEnthalpy.temperature() << ", enthalpy=" << temperatureEnthalpy.enthalpy(); | |
| 39 | ✗ | return out; | |
| 40 | } | ||
| 41 | |||
| 42 | namespace detail { | ||
| 43 | |||
| 44 | 8 | MaterialPropertyPhaseChange_Impl::MaterialPropertyPhaseChange_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 45 | 8 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 46 |
4/6✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 8 times.
✗ Branch 13 not taken.
|
8 | OS_ASSERT(idfObject.iddObject().type() == MaterialPropertyPhaseChange::iddObjectType()); |
| 47 | 8 | } | |
| 48 | |||
| 49 | ✗ | MaterialPropertyPhaseChange_Impl::MaterialPropertyPhaseChange_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 50 | ✗ | bool keepHandle) | |
| 51 | ✗ | : ModelObject_Impl(other, model, keepHandle) { | |
| 52 | ✗ | OS_ASSERT(other.iddObject().type() == MaterialPropertyPhaseChange::iddObjectType()); | |
| 53 | ✗ | } | |
| 54 | |||
| 55 | 2 | MaterialPropertyPhaseChange_Impl::MaterialPropertyPhaseChange_Impl(const MaterialPropertyPhaseChange_Impl& other, Model_Impl* model, | |
| 56 | 2 | bool keepHandle) | |
| 57 | 2 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 58 | |||
| 59 | ✗ | const std::vector<std::string>& MaterialPropertyPhaseChange_Impl::outputVariableNames() const { | |
| 60 | ✗ | static const std::vector<std::string> result; | |
| 61 | ✗ | return result; | |
| 62 | } | ||
| 63 | |||
| 64 | ✗ | IddObjectType MaterialPropertyPhaseChange_Impl::iddObjectType() const { | |
| 65 | ✗ | return MaterialPropertyPhaseChange::iddObjectType(); | |
| 66 | } | ||
| 67 | |||
| 68 | 1 | std::string MaterialPropertyPhaseChange_Impl::materialName() const { | |
| 69 | boost::optional<Material> material = | ||
| 70 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | getObject<ModelObject>().getModelObjectTarget<Material>(OS_MaterialProperty_PhaseChangeFields::MaterialName); |
| 71 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
|
1 | OS_ASSERT(material); |
| 72 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
2 | return material.get().name().get(); |
| 73 | 1 | } | |
| 74 | |||
| 75 | 2 | Material MaterialPropertyPhaseChange_Impl::material() const { | |
| 76 | boost::optional<Material> material = | ||
| 77 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | getObject<ModelObject>().getModelObjectTarget<Material>(OS_MaterialProperty_PhaseChangeFields::MaterialName); |
| 78 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(material); |
| 79 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | return material.get(); |
| 80 | 2 | } | |
| 81 | |||
| 82 | 4 | double MaterialPropertyPhaseChange_Impl::temperatureCoefficientforThermalConductivity() const { | |
| 83 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_MaterialProperty_PhaseChangeFields::TemperatureCoefficientforThermalConductivity, true); |
| 84 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(value); |
| 85 |
1/1✓ Branch 1 taken 4 times.
|
8 | return value.get(); |
| 86 | } | ||
| 87 | |||
| 88 | 3 | bool MaterialPropertyPhaseChange_Impl::isTemperatureCoefficientforThermalConductivityDefaulted() const { | |
| 89 | 3 | return isEmpty(OS_MaterialProperty_PhaseChangeFields::TemperatureCoefficientforThermalConductivity); | |
| 90 | } | ||
| 91 | |||
| 92 | 7 | std::vector<TemperatureEnthalpy> MaterialPropertyPhaseChange_Impl::temperatureEnthalpys() const { | |
| 93 | 7 | std::vector<TemperatureEnthalpy> result; | |
| 94 | |||
| 95 |
1/1✓ Branch 1 taken 7 times.
|
7 | std::vector<IdfExtensibleGroup> groups = extensibleGroups(); |
| 96 | |||
| 97 |
2/2✓ Branch 5 taken 22 times.
✓ Branch 6 taken 7 times.
|
29 | for (const auto& group : groups) { |
| 98 | boost::optional<double> temperature = | ||
| 99 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | group.cast<WorkspaceExtensibleGroup>().getDouble(OS_MaterialProperty_PhaseChangeExtensibleFields::Temperature); |
| 100 | boost::optional<double> enthalpy = | ||
| 101 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | group.cast<WorkspaceExtensibleGroup>().getDouble(OS_MaterialProperty_PhaseChangeExtensibleFields::Enthalpy); |
| 102 | |||
| 103 |
3/6✓ Branch 0 taken 22 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 22 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 22 times.
✗ Branch 5 not taken.
|
44 | if (temperature && enthalpy) { |
| 104 |
3/3✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
✓ Branch 7 taken 22 times.
|
22 | TemperatureEnthalpy temperatureEnthalpy(temperature.get(), enthalpy.get()); |
| 105 |
1/1✓ Branch 1 taken 22 times.
|
22 | result.push_back(temperatureEnthalpy); |
| 106 | } | ||
| 107 | } | ||
| 108 | |||
| 109 | 14 | return result; | |
| 110 | 7 | } | |
| 111 | |||
| 112 | 51 | unsigned int MaterialPropertyPhaseChange_Impl::numberofTemperatureEnthalpys() const { | |
| 113 | 51 | return numExtensibleGroups(); | |
| 114 | } | ||
| 115 | |||
| 116 | 2 | bool MaterialPropertyPhaseChange_Impl::setTemperatureCoefficientforThermalConductivity(double temperatureCoefficientforThermalConductivity) { | |
| 117 | bool result = | ||
| 118 | 2 | setDouble(OS_MaterialProperty_PhaseChangeFields::TemperatureCoefficientforThermalConductivity, temperatureCoefficientforThermalConductivity); | |
| 119 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 120 | 2 | return result; | |
| 121 | } | ||
| 122 | |||
| 123 | 1 | void MaterialPropertyPhaseChange_Impl::resetTemperatureCoefficientforThermalConductivity() { | |
| 124 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_MaterialProperty_PhaseChangeFields::TemperatureCoefficientforThermalConductivity, ""); |
| 125 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 126 | 1 | } | |
| 127 | |||
| 128 | 35 | bool MaterialPropertyPhaseChange_Impl::addTemperatureEnthalpy(const TemperatureEnthalpy& temperatureEnthalpy) { | |
| 129 | bool result; | ||
| 130 | |||
| 131 | 35 | unsigned int num = numberofTemperatureEnthalpys(); | |
| 132 | // Max number of temperature-enthalpys is 16 | ||
| 133 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 35 times.
|
35 | if (num >= 16) { |
| 134 | ✗ | LOG(Warn, briefDescription() << " already has 16 temperature-enthalpys which is the limit"); | |
| 135 | ✗ | result = false; | |
| 136 | } else { | ||
| 137 | // Push an extensible group | ||
| 138 |
3/3✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
✓ Branch 7 taken 35 times.
|
35 | auto eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); |
| 139 |
2/2✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
|
35 | bool temperature = eg.setDouble(OS_MaterialProperty_PhaseChangeExtensibleFields::Temperature, temperatureEnthalpy.temperature()); |
| 140 |
2/2✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
|
35 | bool enthalpy = eg.setDouble(OS_MaterialProperty_PhaseChangeExtensibleFields::Enthalpy, temperatureEnthalpy.enthalpy()); |
| 141 |
2/4✓ Branch 0 taken 35 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 35 times.
✗ Branch 3 not taken.
|
35 | if (temperature && enthalpy) { |
| 142 | 35 | result = true; | |
| 143 | } else { | ||
| 144 | // Something went wrong | ||
| 145 | // So erase the new extensible group | ||
| 146 | ✗ | getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); | |
| 147 | ✗ | result = false; | |
| 148 | } | ||
| 149 | 35 | result = true; | |
| 150 | 35 | } | |
| 151 | 35 | return result; | |
| 152 | } | ||
| 153 | |||
| 154 | 23 | bool MaterialPropertyPhaseChange_Impl::addTemperatureEnthalpy(double temperature, double enthalpy) { | |
| 155 | // Make a temperature-enthalpy, and then call the above function | ||
| 156 |
1/1✓ Branch 1 taken 23 times.
|
23 | TemperatureEnthalpy temperatureEnthalpy(temperature, enthalpy); |
| 157 |
1/1✓ Branch 1 taken 23 times.
|
46 | return addTemperatureEnthalpy(temperatureEnthalpy); |
| 158 | } | ||
| 159 | |||
| 160 | 4 | bool MaterialPropertyPhaseChange_Impl::addTemperatureEnthalpys(const std::vector<TemperatureEnthalpy>& temperatureEnthalpys) { | |
| 161 | 4 | unsigned int num = numberofTemperatureEnthalpys(); | |
| 162 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
|
4 | if ((num + temperatureEnthalpys.size()) > 16) { |
| 163 | ✗ | LOG(Warn, briefDescription() << " would have more than the 16 maximum temperature-enthalpys"); | |
| 164 | ✗ | return false; | |
| 165 | } else { | ||
| 166 |
2/2✓ Branch 5 taken 11 times.
✓ Branch 6 taken 4 times.
|
15 | for (const TemperatureEnthalpy& temperatureEnthalpy : temperatureEnthalpys) { |
| 167 |
1/1✓ Branch 1 taken 11 times.
|
11 | addTemperatureEnthalpy(temperatureEnthalpy); |
| 168 | } | ||
| 169 | 4 | return true; | |
| 170 | } | ||
| 171 | } | ||
| 172 | |||
| 173 | 2 | bool MaterialPropertyPhaseChange_Impl::removeTemperatureEnthalpy(unsigned groupIndex) { | |
| 174 | bool result; | ||
| 175 | |||
| 176 | 2 | unsigned int num = numberofTemperatureEnthalpys(); | |
| 177 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | if (groupIndex < num) { |
| 178 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | getObject<ModelObject>().eraseExtensibleGroup(groupIndex); |
| 179 | 1 | result = true; | |
| 180 | } else { | ||
| 181 | 1 | result = false; | |
| 182 | } | ||
| 183 | 2 | return result; | |
| 184 | } | ||
| 185 | |||
| 186 | 3 | void MaterialPropertyPhaseChange_Impl::removeAllTemperatureEnthalpys() { | |
| 187 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | getObject<ModelObject>().clearExtensibleGroups(); |
| 188 | 3 | } | |
| 189 | |||
| 190 | } // namespace detail | ||
| 191 | |||
| 192 | 6 | MaterialPropertyPhaseChange::MaterialPropertyPhaseChange(StandardOpaqueMaterial& material) | |
| 193 |
3/3✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
|
6 | : ModelObject(MaterialPropertyPhaseChange::iddObjectType(), material.model()) { |
| 194 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 6 times.
✗ Branch 5 not taken.
|
6 | OS_ASSERT(getImpl<detail::MaterialPropertyPhaseChange_Impl>()); |
| 195 | |||
| 196 |
3/3✓ Branch 1 taken 6 times.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 5 times.
|
12 | if (material.materialPropertyPhaseChange()) { |
| 197 |
19/19✓ 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 17 taken 1 time.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
✓ Branch 29 taken 1 time.
✓ Branch 32 taken 1 time.
✓ Branch 35 taken 1 time.
✓ Branch 38 taken 1 time.
✓ Branch 41 taken 1 time.
✓ Branch 44 taken 1 time.
✓ Branch 47 taken 1 time.
✓ Branch 50 taken 1 time.
✓ Branch 53 taken 1 time.
✓ Branch 58 taken 1 time.
✓ Branch 61 taken 1 time.
|
1 | LOG_AND_THROW("Material '" << material.nameString() << "' already has an associated MaterialPropertyPhaseChange object"); |
| 198 | } | ||
| 199 | |||
| 200 | 5 | bool ok = true; | |
| 201 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
|
5 | OS_ASSERT(ok); |
| 202 | |||
| 203 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | ok = setPointer(OS_MaterialProperty_PhaseChangeFields::MaterialName, material.handle()); |
| 204 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
|
5 | OS_ASSERT(ok); |
| 205 | |||
| 206 | // These from CondFD1ZonePurchAirAutoSizeWithPCM.idf for E1 - 3 / 4 IN PLASTER OR GYP BOARD. | ||
| 207 | // They should be modified by user! | ||
| 208 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = addTemperatureEnthalpy(-20, 0.1); |
| 209 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
|
5 | OS_ASSERT(ok); |
| 210 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = addTemperatureEnthalpy(22, 18260); |
| 211 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
|
5 | OS_ASSERT(ok); |
| 212 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = addTemperatureEnthalpy(22.1, 32000); |
| 213 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
|
5 | OS_ASSERT(ok); |
| 214 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = addTemperatureEnthalpy(60, 71000); |
| 215 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
✗ Branch 3 not taken.
|
5 | OS_ASSERT(ok); |
| 216 | 6 | } | |
| 217 | |||
| 218 | ✗ | MaterialPropertyPhaseChange::MaterialPropertyPhaseChange(MasslessOpaqueMaterial& material) | |
| 219 | ✗ | : ModelObject(MaterialPropertyPhaseChange::iddObjectType(), material.model()) { | |
| 220 | ✗ | OS_ASSERT(getImpl<detail::MaterialPropertyPhaseChange_Impl>()); | |
| 221 | |||
| 222 | ✗ | if (material.materialPropertyPhaseChange()) { | |
| 223 | ✗ | LOG_AND_THROW("Material '" << material.nameString() << "' already has an associated MaterialPropertyPhaseChange object"); | |
| 224 | } | ||
| 225 | |||
| 226 | ✗ | bool ok = true; | |
| 227 | ✗ | OS_ASSERT(ok); | |
| 228 | |||
| 229 | ✗ | ok = setPointer(OS_MaterialProperty_PhaseChangeFields::MaterialName, material.handle()); | |
| 230 | ✗ | OS_ASSERT(ok); | |
| 231 | |||
| 232 | // These from CondFD1ZonePurchAirAutoSizeWithPCM.idf for E1 - 3 / 4 IN PLASTER OR GYP BOARD. | ||
| 233 | // They should be modified by user! | ||
| 234 | ✗ | ok = addTemperatureEnthalpy(-20, 0.1); | |
| 235 | ✗ | OS_ASSERT(ok); | |
| 236 | ✗ | ok = addTemperatureEnthalpy(22, 18260); | |
| 237 | ✗ | OS_ASSERT(ok); | |
| 238 | ✗ | ok = addTemperatureEnthalpy(22.1, 32000); | |
| 239 | ✗ | OS_ASSERT(ok); | |
| 240 | ✗ | ok = addTemperatureEnthalpy(60, 71000); | |
| 241 | ✗ | OS_ASSERT(ok); | |
| 242 | ✗ | } | |
| 243 | |||
| 244 | 2 | MaterialPropertyPhaseChange::MaterialPropertyPhaseChange(StandardOpaqueMaterial& material, | |
| 245 | 2 | const std::vector<TemperatureEnthalpy>& temperatureEnthalpys) | |
| 246 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | : ModelObject(MaterialPropertyPhaseChange::iddObjectType(), material.model()) { |
| 247 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 5 not taken.
|
2 | OS_ASSERT(getImpl<detail::MaterialPropertyPhaseChange_Impl>()); |
| 248 | |||
| 249 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
4 | if (material.materialPropertyPhaseChange()) { |
| 250 | ✗ | LOG_AND_THROW("Material '" << material.nameString() << "' already has an associated MaterialPropertyPhaseChange object"); | |
| 251 | } | ||
| 252 | |||
| 253 | 2 | bool ok = true; | |
| 254 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 255 | |||
| 256 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | ok = setPointer(OS_MaterialProperty_PhaseChangeFields::MaterialName, material.handle()); |
| 257 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 258 | |||
| 259 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = addTemperatureEnthalpys(temperatureEnthalpys); |
| 260 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 261 | 2 | } | |
| 262 | |||
| 263 | ✗ | MaterialPropertyPhaseChange::MaterialPropertyPhaseChange(MasslessOpaqueMaterial& material, | |
| 264 | ✗ | const std::vector<TemperatureEnthalpy>& temperatureEnthalpys) | |
| 265 | ✗ | : ModelObject(MaterialPropertyPhaseChange::iddObjectType(), material.model()) { | |
| 266 | ✗ | OS_ASSERT(getImpl<detail::MaterialPropertyPhaseChange_Impl>()); | |
| 267 | |||
| 268 | ✗ | if (material.materialPropertyPhaseChange()) { | |
| 269 | ✗ | LOG_AND_THROW("Material '" << material.nameString() << "' already has an associated MaterialPropertyPhaseChange object"); | |
| 270 | } | ||
| 271 | |||
| 272 | ✗ | bool ok = true; | |
| 273 | ✗ | OS_ASSERT(ok); | |
| 274 | |||
| 275 | ✗ | ok = setPointer(OS_MaterialProperty_PhaseChangeFields::MaterialName, material.handle()); | |
| 276 | ✗ | OS_ASSERT(ok); | |
| 277 | |||
| 278 | ✗ | ok = addTemperatureEnthalpys(temperatureEnthalpys); | |
| 279 | ✗ | OS_ASSERT(ok); | |
| 280 | ✗ | } | |
| 281 | |||
| 282 | 9100 | IddObjectType MaterialPropertyPhaseChange::iddObjectType() { | |
| 283 |
1/1✓ Branch 1 taken 9100 times.
|
9100 | return IddObjectType(IddObjectType::OS_MaterialProperty_PhaseChange); |
| 284 | } | ||
| 285 | |||
| 286 | 1 | std::string MaterialPropertyPhaseChange::materialName() const { | |
| 287 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->materialName(); |
| 288 | } | ||
| 289 | |||
| 290 | 2 | Material MaterialPropertyPhaseChange::material() const { | |
| 291 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->material(); |
| 292 | } | ||
| 293 | |||
| 294 | 4 | double MaterialPropertyPhaseChange::temperatureCoefficientforThermalConductivity() const { | |
| 295 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->temperatureCoefficientforThermalConductivity(); |
| 296 | } | ||
| 297 | |||
| 298 | 3 | bool MaterialPropertyPhaseChange::isTemperatureCoefficientforThermalConductivityDefaulted() const { | |
| 299 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->isTemperatureCoefficientforThermalConductivityDefaulted(); |
| 300 | } | ||
| 301 | |||
| 302 | 7 | std::vector<TemperatureEnthalpy> MaterialPropertyPhaseChange::temperatureEnthalpys() const { | |
| 303 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->temperatureEnthalpys(); |
| 304 | } | ||
| 305 | |||
| 306 | 10 | unsigned int MaterialPropertyPhaseChange::numberofTemperatureEnthalpys() const { | |
| 307 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->numberofTemperatureEnthalpys(); |
| 308 | } | ||
| 309 | |||
| 310 | 2 | bool MaterialPropertyPhaseChange::setTemperatureCoefficientforThermalConductivity(double temperatureCoefficientforThermalConductivity) { | |
| 311 |
1/1✓ Branch 3 taken 2 times.
|
4 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->setTemperatureCoefficientforThermalConductivity( |
| 312 | 4 | temperatureCoefficientforThermalConductivity); | |
| 313 | } | ||
| 314 | |||
| 315 | 1 | void MaterialPropertyPhaseChange::resetTemperatureCoefficientforThermalConductivity() { | |
| 316 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::MaterialPropertyPhaseChange_Impl>()->resetTemperatureCoefficientforThermalConductivity(); |
| 317 | 1 | } | |
| 318 | |||
| 319 | 1 | bool MaterialPropertyPhaseChange::addTemperatureEnthalpy(const TemperatureEnthalpy& temperatureEnthalpy) { | |
| 320 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->addTemperatureEnthalpy(temperatureEnthalpy); |
| 321 | } | ||
| 322 | |||
| 323 | 23 | bool MaterialPropertyPhaseChange::addTemperatureEnthalpy(double temperature, double enthalpy) { | |
| 324 |
1/1✓ Branch 3 taken 23 times.
|
23 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->addTemperatureEnthalpy(temperature, enthalpy); |
| 325 | } | ||
| 326 | |||
| 327 | 4 | bool MaterialPropertyPhaseChange::addTemperatureEnthalpys(const std::vector<TemperatureEnthalpy>& temperatureEnthalpys) { | |
| 328 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::MaterialPropertyPhaseChange_Impl>()->addTemperatureEnthalpys(temperatureEnthalpys); |
| 329 | } | ||
| 330 | |||
| 331 | 2 | void MaterialPropertyPhaseChange::removeTemperatureEnthalpy(unsigned groupIndex) { | |
| 332 |
1/1✓ Branch 3 taken 2 times.
|
2 | getImpl<detail::MaterialPropertyPhaseChange_Impl>()->removeTemperatureEnthalpy(groupIndex); |
| 333 | 2 | } | |
| 334 | |||
| 335 | 3 | void MaterialPropertyPhaseChange::removeAllTemperatureEnthalpys() { | |
| 336 |
1/1✓ Branch 3 taken 3 times.
|
3 | getImpl<detail::MaterialPropertyPhaseChange_Impl>()->removeAllTemperatureEnthalpys(); |
| 337 | 3 | } | |
| 338 | |||
| 339 | /// @cond | ||
| 340 | 11 | MaterialPropertyPhaseChange::MaterialPropertyPhaseChange(std::shared_ptr<detail::MaterialPropertyPhaseChange_Impl> impl) | |
| 341 |
1/1✓ Branch 3 taken 11 times.
|
11 | : ModelObject(std::move(impl)) {} |
| 342 | /// @endcond | ||
| 343 | |||
| 344 | } // namespace model | ||
| 345 | } // namespace openstudio | ||
| 346 |