honeybee-openstudio 2.12.1 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/honeybee-openstudio.gemspec +1 -1
  3. data/lib/files/urbanopt_Gemfile +1 -1
  4. data/lib/from_openstudio/material/opaque.rb +57 -0
  5. data/lib/from_openstudio/material/opaque_no_mass.rb +63 -0
  6. data/lib/from_openstudio/material/window_blind.rb +78 -0
  7. data/lib/from_openstudio/material/window_gas.rb +51 -0
  8. data/lib/from_openstudio/material/window_gas_custom.rb +94 -0
  9. data/lib/from_openstudio/material/window_gas_mixture.rb +70 -0
  10. data/lib/from_openstudio/material/window_glazing.rb +77 -0
  11. data/lib/from_openstudio/material/window_simpleglazsys.rb +55 -0
  12. data/lib/from_openstudio/model.rb +51 -0
  13. data/lib/measures/from_gbxml_model/LICENSE.md +23 -0
  14. data/lib/measures/from_gbxml_model/README.md +32 -0
  15. data/lib/measures/from_gbxml_model/measure.rb +114 -0
  16. data/lib/measures/from_gbxml_model/measure.xml +131 -0
  17. data/lib/measures/from_gbxml_model/tests/from_gbxml_model_test.rb +107 -0
  18. data/lib/measures/from_idf_model/LICENSE.md +23 -0
  19. data/lib/measures/from_idf_model/README.md +32 -0
  20. data/lib/measures/from_idf_model/measure.rb +114 -0
  21. data/lib/measures/from_idf_model/measure.xml +110 -0
  22. data/lib/measures/from_idf_model/tests/from_idf_model_test.rb +107 -0
  23. data/lib/measures/from_openstudio_model/LICENSE.md +23 -0
  24. data/lib/measures/from_openstudio_model/README.md +32 -0
  25. data/lib/measures/from_openstudio_model/measure.rb +114 -0
  26. data/lib/measures/from_openstudio_model/measure.xml +95 -0
  27. data/lib/measures/from_openstudio_model/tests/from_openstudio_model_test.rb +107 -0
  28. metadata +25 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ef58abc9f7b43762b91e92f066f13ca05dae722a04efb3040e68a1c97a4cf37
4
- data.tar.gz: e66dc4284e1df829aeef6da00978f8da79dce2c82dc74479299196ce09d9c163
3
+ metadata.gz: e2569dc4abe1834c7a927df0a13bec94de8ecc8584cf3b8edb8e2affd5d0a1de
4
+ data.tar.gz: 6684407214c56bcd19be74e7d93ed6aa4a9f2711a33b7dafdcce8341d63b75de
5
5
  SHA512:
6
- metadata.gz: a552ccbd48ed6bae5fd5499a9d0e204dae93bd06508e4634afb777422d5d9b4a1f139d53cedc3e13f9ec4bd68079857eaa9aa84b341b18eb07b987e35e930924
7
- data.tar.gz: b1bb5fb3d8e245e0f41f196a7afd71b3423eab4aa93b2e56eb7a19d2bc9d2f5ded6bce850a5674b701c4b34003cdc0b83fd2478eeba3235b2d9b88f758d24e0e
6
+ metadata.gz: 2b81e0a2675b41298188da7b9d6e87ff2476304776358823796c36277887b21d1ffe7b9b5870ec19e9d80a5afe3fdd99a331cd4183ebac2654e7ec8c8c9d537b
7
+ data.tar.gz: c6c97f48723e86f865ba373471966306e8a5c7975a6a841087ad9014cf7d54c46394daba91c3fcb9c0fc1c6359943f44889364e00992ea3c43dcaaa90f4ba8e5
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'honeybee-openstudio'
7
- spec.version = '2.12.1'
7
+ spec.version = '2.16.0'
8
8
  spec.authors = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
9
9
  spec.email = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
10
10
 
@@ -29,4 +29,4 @@ else
29
29
  end
30
30
 
31
31
  # include the honeybee-openstudio-gem
32
- gem 'honeybee-openstudio', '2.11.3'
32
+ gem 'honeybee-openstudio', '2.12.1'
@@ -0,0 +1,57 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/material/opaque'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class EnergyMaterial < ModelObject
37
+
38
+ def self.from_material(material)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'EnergyMaterial'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = material.nameString
44
+ hash[:thickness] = material.thickness
45
+ hash[:conductivity] = material.conductivity
46
+ hash[:density] = material.density
47
+ hash[:specific_heat] = material.specificHeat
48
+ hash[:roughness] = material.roughness
49
+ hash[:thermal_absorptance] = material.thermalAbsorptance
50
+ hash[:solar_absorptance] = material.solarAbsorptance
51
+ hash[:visible_absorptance] = material.visibleAbsorptance
52
+
53
+ hash
54
+ end
55
+
56
+ end # EnergyMaterial
57
+ end # Honeybee
@@ -0,0 +1,63 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/material/opaque_no_mass.rb'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class EnergyMaterialNoMass < ModelObject
37
+
38
+ def self.from_material(material)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'EnergyMaterialNoMass'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = material.nameString
44
+ hash[:r_value] = material.thermalResistance
45
+ hash[:roughness] = material.roughness
46
+ # check if boost optional object is empty
47
+ unless material.thermalAbsorptance.empty?
48
+ hash[:thermal_absorptance] = material.thermalAbsorptance.get
49
+ end
50
+ # check if boost optional object is empty
51
+ unless material.solarAbsorptance.empty?
52
+ hash[:solar_absorptance] = material.solarAbsorptance.get
53
+ end
54
+ # check if boost optional object is empty
55
+ unless material.visibleAbsorptance.empty?
56
+ hash[:visible_absorptance] = material.visibleAbsorptance.get
57
+ end
58
+
59
+ hash
60
+ end
61
+
62
+ end #EnergyMaterialNoMass
63
+ end # Honeybee
@@ -0,0 +1,78 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/material/window_blind'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class EnergyWindowMaterialBlind
37
+
38
+ def self.from_material(material)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'EnergyWindowMaterialBlind'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = material.nameString
44
+ hash[:slat_orientation] = material.slatOrientation
45
+ hash[:slat_width] = material.slatWidth
46
+ hash[:slat_separation] = material.slatSeparation
47
+ hash[:slat_thickness] = material.slatThickness
48
+ hash[:slat_width] = material.slatWidth
49
+ hash[:slat_angle] = material.slatAngle
50
+ hash[:slat_conductivity] = material.slatConductivity
51
+ hash[:beam_solar_transmittance] = material.slatBeamSolarTransmittance
52
+ hash[:beam_solar_reflectance] = material.frontSideSlatBeamSolarReflectance
53
+ hash[:beam_solar_reflectance_back] = material.backSideSlatBeamSolarReflectance
54
+ hash[:diffuse_solar_reflectance] = material.frontSideSlatDiffuseSolarReflectance
55
+ hash[:diffuse_solar_reflectance_back] = material.backSideSlatDiffuseSolarReflectance
56
+ hash[:diffuse_visible_transmittance] = material.slatDiffuseVisibleTransmittance
57
+ # check if boost optional object is empty
58
+ unless material.frontSideSlatDiffuseVisibleReflectance.nil?
59
+ hash[:diffuse_visible_reflectance] = material.frontSideSlatDiffuseVisibleReflectance.get
60
+ end
61
+ # check if boost optional object is empty
62
+ unless material.backSideSlatDiffuseVisibleReflectance.nil?
63
+ hash[:diffuse_visible_reflectance_back] = material.backSideSlatDiffuseVisibleReflectance.get
64
+ end
65
+ hash[:infrared_transmittance] = material.slatInfraredHemisphericalTransmittance
66
+ hash[:emissivity] = material.frontSideSlatInfraredHemisphericalEmissivity
67
+ hash[:emissivity_back] = material.backSideSlatInfraredHemisphericalEmissivity
68
+ hash[:distance_to_glass] = material.blindtoGlassDistance
69
+ hash[:top_opening_multiplier] = material.blindTopOpeningMultiplier
70
+ hash[:bottom_opening_multiplier] = material.blindBottomOpeningMultiplier
71
+ hash[:left_opening_multiplier] = material.blindLeftSideOpeningMultiplier
72
+ hash[:right_opening_multiplier] = material.blindRightSideOpeningMultiplier
73
+
74
+ hash
75
+ end
76
+
77
+ end # EnergyWindowMaterialBlind
78
+ end # Honeybee
@@ -0,0 +1,51 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/material/window_gas'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class EnergyWindowMaterialGas
37
+
38
+ def self.from_material(material)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'EnergyWindowMaterialGas'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = material.nameString
44
+ hash[:thickness] = material.thickness
45
+ hash[:gas_type] = material.gasType
46
+
47
+ hash
48
+ end
49
+
50
+ end # EnergyWindowMaterialGas
51
+ end # Honeybee
@@ -0,0 +1,94 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/material/window_gas_custom'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class EnergyWindowMaterialGasCustom
37
+
38
+ def self.from_material(material)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'EnergyWindowMaterialGasCustom'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = material.nameString
44
+ hash[:thickness] = material.thickness
45
+ # check if boost optional object is empty
46
+ unless material.customConductivityCoefficientA.empty?
47
+ hash[:conductivity_coeff_a] = material.customConductivityCoefficientA.get
48
+ end
49
+ # check if boost optional object is empty
50
+ unless material.customConductivityCoefficientB.empty?
51
+ hash[:conductivity_coeff_b] = material.customConductivityCoefficientB.get
52
+ end
53
+ # check if boost optional object is empty
54
+ unless material.customConductivityCoefficientC.empty?
55
+ hash[:conductivity_coeff_c] = material.customConductivityCoefficientC.get
56
+ end
57
+ # check if boost optional object is empty
58
+ unless material.viscosityCoefficientA.empty?
59
+ hash[:viscosity_coeff_a] = material.viscosityCoefficientA.get
60
+ end
61
+ # check if boost optional object is empty
62
+ unless material.viscosityCoefficientB.empty?
63
+ hash[:viscosity_coeff_b] = material.viscosityCoefficientB.get
64
+ end
65
+ # check if boost optional object is empty
66
+ unless material.viscosityCoefficientC.empty?
67
+ hash[:viscosity_coeff_c] = material.viscosityCoefficientC.get
68
+ end
69
+ # check if boost optional object is empty
70
+ unless material.specificHeatCoefficientA.empty?
71
+ hash[:specific_heat_coeff_a] = material.specificHeatCoefficientA.get
72
+ end
73
+ # check if boost optional object is empty
74
+ unless material.specificHeatCoefficientB.empty?
75
+ hash[:specific_heat_coeff_b] = material.specificHeatCoefficientB.get
76
+ end
77
+ # check if boost optional object is empty
78
+ unless material.specificHeatCoefficientC.empty?
79
+ hash[:specific_heat_coeff_c] = material.specificHeatCoefficientC.get
80
+ end
81
+ # check if boost optional object is empty
82
+ unless material.specificHeatRatio.empty?
83
+ hash[:specific_heat_ratio] = material.specificHeatRatio.get
84
+ end
85
+ # check if boost optional object is empty
86
+ unless material.molecularWeight.empty?
87
+ hash[:molecular_weight] = material.molecularWeight.get
88
+ end
89
+
90
+ hash
91
+ end
92
+
93
+ end # EnergyWindowMaterialGasCustom
94
+ end # Honeybee
@@ -0,0 +1,70 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/material/window_gas_mixture'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class EnergyWindowMaterialGasMixture
37
+
38
+ def self.from_material(material)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'EnergyWindowMaterialGasMixture'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = material.nameString
44
+ hash[:thickness] = material.thickness
45
+ hash[:gas_types] = []
46
+ hash[:gas_fractions] = []
47
+ number_of_gases = material.numberofGasesinMixture
48
+ if number_of_gases > 1
49
+ (1..number_of_gases).each do |n|
50
+ hash[:gas_types] << material.send('gas' + n.to_s + 'Type')
51
+ end
52
+ hash[:gas_fractions] << material.gas1Fraction
53
+ hash[:gas_fractions] << material.gas2Fraction
54
+ if number_of_gases > 2
55
+ unless material.gas3Fraction.empty?
56
+ hash[:gas_fractions] << material.gas3Fraction.get
57
+ end
58
+ if number_of_gases > 3
59
+ unless material.gas4Fraction.empty?
60
+ hash[:gas_fractions] << material.gas4Fraction.get
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+ hash
67
+ end
68
+
69
+ end # EnergyWindowMaterialGasMixture
70
+ end # Honeybee