openstudio-standards 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/standards/OpenStudio_Standards.xlsx +0 -0
- data/data/standards/OpenStudio_Standards_boilers.json +62 -4
- data/data/standards/OpenStudio_Standards_chillers.json +778 -68
- data/data/standards/OpenStudio_Standards_construction_sets.json +52 -93
- data/data/standards/OpenStudio_Standards_curve_biquadratics.json +36 -36
- data/data/standards/OpenStudio_Standards_curve_quadratics.json +3 -3
- data/data/standards/OpenStudio_Standards_heat_pumps.json +840 -0
- data/data/standards/OpenStudio_Standards_heat_pumps_heating.json +352 -0
- data/data/standards/OpenStudio_Standards_heat_rejection.json +48 -0
- data/data/standards/OpenStudio_Standards_motors.json +270 -0
- data/data/standards/OpenStudio_Standards_space_types.json +10390 -2824
- data/data/standards/OpenStudio_Standards_unitary_acs.json +794 -18
- data/data/weather/USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.ddy +538 -0
- data/data/weather/USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.epw +8768 -0
- data/data/weather/USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.stat +493 -0
- data/data/weather/USA_CO_Denver.Intl.AP.725650_TMY3.ddy +536 -0
- data/data/weather/USA_CO_Denver.Intl.AP.725650_TMY3.epw +8768 -0
- data/data/weather/USA_CO_Denver.Intl.AP.725650_TMY3.stat +554 -0
- data/data/weather/USA_CO_Fort.Collins.AWOS.724769_TMY3.ddy +536 -0
- data/data/weather/USA_CO_Fort.Collins.AWOS.724769_TMY3.epw +8768 -0
- data/data/weather/USA_CO_Fort.Collins.AWOS.724769_TMY3.stat +554 -0
- data/data/weather/envelope_info.csv +6 -0
- data/lib/openstudio-standards.rb +10 -11
- data/lib/openstudio-standards/btap/compliance.rb +251 -969
- data/lib/openstudio-standards/btap/envelope.rb +1 -1
- data/lib/openstudio-standards/btap/fileio.rb +37 -5
- data/lib/openstudio-standards/btap/geometry.rb +27 -17
- data/lib/openstudio-standards/btap/hvac.rb +80 -27
- data/lib/openstudio-standards/hvac_sizing/{HVACSizing.CoilHeatingDXMultiSpeed.rb → Siz.CoilHeatingDXMultiSpeed.rb} +0 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.ControllerOutdoorAir.rb +30 -4
- data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerTwoSpeed.rb +61 -5
- data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerVariableSpeed.rb +37 -7
- data/lib/openstudio-standards/hvac_sizing/Siz.DistrictCooling.rb +27 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.DistrictHeating.rb +27 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsConstantSpeed.rb +55 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsVariableSpeed.rb +55 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb +51 -9
- data/lib/openstudio-standards/hvac_sizing/Siz.Model.rb +99 -17
- data/lib/openstudio-standards/hvac_sizing/Siz.PumpConstantSpeed.rb +1 -1
- data/lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb +29 -6
- data/lib/openstudio-standards/hvac_sizing/Siz.WaterHeaterMixed.rb +16 -0
- data/lib/openstudio-standards/prototypes/Prototype.AirTerminalSingleDuctVAVReheat.rb +43 -48
- data/lib/openstudio-standards/prototypes/Prototype.ControllerWaterCoil.rb +5 -9
- data/lib/openstudio-standards/prototypes/Prototype.Fan.rb +68 -0
- data/lib/openstudio-standards/prototypes/Prototype.FanConstantVolume.rb +39 -43
- data/lib/openstudio-standards/prototypes/Prototype.FanOnOff.rb +49 -51
- data/lib/openstudio-standards/prototypes/Prototype.FanVariableVolume.rb +55 -61
- data/lib/openstudio-standards/prototypes/Prototype.FanZoneExhaust.rb +8 -10
- data/lib/openstudio-standards/prototypes/Prototype.HeatExchangerAirToAirSensibleAndLatent.rb +15 -20
- data/lib/openstudio-standards/prototypes/Prototype.Model.hvac.rb +330 -322
- data/lib/openstudio-standards/prototypes/Prototype.Model.rb +501 -446
- data/lib/openstudio-standards/prototypes/Prototype.Model.swh.rb +221 -230
- data/lib/openstudio-standards/prototypes/Prototype.add_objects.rb +0 -2
- data/lib/openstudio-standards/prototypes/Prototype.full_service_restaurant.rb +130 -137
- data/lib/openstudio-standards/prototypes/Prototype.high_rise_apartment.rb +374 -291
- data/lib/openstudio-standards/prototypes/Prototype.hospital.rb +146 -193
- data/lib/openstudio-standards/prototypes/Prototype.hvac_systems.rb +1315 -1113
- data/lib/openstudio-standards/prototypes/Prototype.large_hotel.rb +65 -88
- data/lib/openstudio-standards/prototypes/Prototype.large_office.rb +101 -156
- data/lib/openstudio-standards/prototypes/Prototype.medium_office.rb +46 -96
- data/lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb +113 -123
- data/lib/openstudio-standards/prototypes/Prototype.outpatient.rb +356 -345
- data/lib/openstudio-standards/prototypes/Prototype.primary_school.rb +48 -103
- data/lib/openstudio-standards/prototypes/Prototype.quick_service_restaurant.rb +115 -123
- data/lib/openstudio-standards/prototypes/Prototype.retail_standalone.rb +30 -39
- data/lib/openstudio-standards/prototypes/Prototype.retail_stripmall.rb +32 -45
- data/lib/openstudio-standards/prototypes/Prototype.secondary_school.rb +98 -258
- data/lib/openstudio-standards/prototypes/Prototype.small_hotel.rb +429 -474
- data/lib/openstudio-standards/prototypes/Prototype.small_office.rb +28 -36
- data/lib/openstudio-standards/prototypes/Prototype.strip_model.rb +7 -7
- data/lib/openstudio-standards/prototypes/Prototype.utilities.rb +172 -146
- data/lib/openstudio-standards/prototypes/Prototype.warehouse.rb +46 -53
- data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +885 -707
- data/lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctParallelPIUReheat.rb +48 -57
- data/lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb +24 -31
- data/lib/openstudio-standards/standards/Standards.BoilerHotWater.rb +80 -93
- data/lib/openstudio-standards/standards/Standards.BuildingStory.rb +69 -0
- data/lib/openstudio-standards/standards/Standards.ChillerElectricEIR.rb +60 -72
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXMultiSpeed.rb +104 -108
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +190 -198
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXTwoSpeed.rb +134 -146
- data/lib/openstudio-standards/standards/Standards.CoilHeatingDXMultiSpeed.rb +56 -60
- data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +151 -161
- data/lib/openstudio-standards/standards/Standards.CoilHeatingGasMultiStage.rb +30 -34
- data/lib/openstudio-standards/standards/Standards.Construction.rb +116 -132
- data/lib/openstudio-standards/standards/Standards.CoolingTower.rb +138 -0
- data/lib/openstudio-standards/standards/Standards.CoolingTowerSingleSpeed.rb +11 -0
- data/lib/openstudio-standards/standards/Standards.CoolingTowerTwoSpeed.rb +11 -0
- data/lib/openstudio-standards/standards/Standards.CoolingTowerVariableSpeed.rb +16 -0
- data/lib/openstudio-standards/standards/Standards.Fan.rb +190 -236
- data/lib/openstudio-standards/standards/Standards.FanConstantVolume.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.FanOnOff.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.FanVariableVolume.rb +168 -14
- data/lib/openstudio-standards/standards/Standards.FanZoneExhaust.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.HeaderedPumpsConstantSpeed.rb +33 -0
- data/lib/openstudio-standards/standards/Standards.HeaderedPumpsVariableSpeed.rb +83 -0
- data/lib/openstudio-standards/standards/Standards.HeatExchangerSensLat.rb +22 -0
- data/lib/openstudio-standards/standards/Standards.Model.rb +2385 -1622
- data/lib/openstudio-standards/standards/Standards.PlanarSurface.rb +83 -35
- data/lib/openstudio-standards/standards/Standards.PlantLoop.rb +805 -395
- data/lib/openstudio-standards/standards/Standards.Pump.rb +139 -119
- data/lib/openstudio-standards/standards/Standards.PumpConstantSpeed.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.PumpVariableSpeed.rb +16 -15
- data/lib/openstudio-standards/standards/Standards.ScheduleCompact.rb +35 -0
- data/lib/openstudio-standards/standards/Standards.ScheduleConstant.rb +7 -13
- data/lib/openstudio-standards/standards/Standards.ScheduleRuleset.rb +144 -59
- data/lib/openstudio-standards/standards/Standards.Space.rb +1509 -1326
- data/lib/openstudio-standards/standards/Standards.SpaceType.rb +254 -262
- data/lib/openstudio-standards/standards/Standards.SubSurface.rb +105 -105
- data/lib/openstudio-standards/standards/Standards.Surface.rb +27 -31
- data/lib/openstudio-standards/standards/Standards.ThermalZone.rb +882 -157
- data/lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb +179 -69
- data/lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb +75 -0
- data/lib/openstudio-standards/utilities/logging.rb +31 -38
- data/lib/openstudio-standards/utilities/simulation.rb +118 -82
- data/lib/openstudio-standards/version.rb +1 -1
- data/lib/openstudio-standards/weather/Weather.Model.rb +382 -390
- data/lib/openstudio-standards/weather/Weather.stat_file.rb +159 -78
- metadata +59 -6
@@ -1,50 +1,48 @@
|
|
1
1
|
|
2
2
|
# open the class to add methods to return sizing values
|
3
3
|
class OpenStudio::Model::CoilHeatingGasMultiStage
|
4
|
-
|
5
|
-
def setStandardEfficiencyAndCurves(template, standards)
|
6
|
-
|
4
|
+
def apply_efficiency_and_curves(template, standards)
|
7
5
|
successfully_set_all_properties = true
|
8
|
-
|
6
|
+
|
9
7
|
# Get the coil capacity
|
10
8
|
capacity_w = nil
|
11
|
-
htg_stages =
|
9
|
+
htg_stages = stages
|
12
10
|
if htg_stages.last.nominalCapacity.is_initialized
|
13
11
|
capacity_w = htg_stages.last.nominalCapacity.get
|
14
|
-
elsif
|
15
|
-
capacity_w =
|
12
|
+
elsif autosizedStage4NominalCapacity.is_initialized
|
13
|
+
capacity_w = autosizedStage4NominalCapacity.get
|
16
14
|
else
|
17
|
-
OpenStudio
|
15
|
+
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXMultiSpeed', "For #{name} capacity is not available, cannot apply efficiency standard.")
|
18
16
|
successfully_set_all_properties = false
|
19
17
|
return successfully_set_all_properties
|
20
|
-
end
|
18
|
+
end
|
21
19
|
|
22
20
|
# Set number of stages for NECB 2011
|
23
|
-
if
|
24
|
-
num_stages = (capacity_w/(66.0*1000.0)+0.5).round
|
25
|
-
num_stages = [num_stages,4].min
|
21
|
+
if template == 'NECB 2011'
|
22
|
+
num_stages = (capacity_w / (66.0 * 1000.0) + 0.5).round
|
23
|
+
num_stages = [num_stages, 4].min
|
26
24
|
stage_cap = []
|
27
|
-
if
|
28
|
-
stage_cap[0] = capacity_w/2.0
|
29
|
-
stage_cap[1] = 2.0*stage_cap[0]
|
30
|
-
stage_cap[2] = stage_cap[1]+0.1
|
31
|
-
stage_cap[3] = stage_cap[2]+0.1
|
25
|
+
if num_stages == 1
|
26
|
+
stage_cap[0] = capacity_w / 2.0
|
27
|
+
stage_cap[1] = 2.0 * stage_cap[0]
|
28
|
+
stage_cap[2] = stage_cap[1] + 0.1
|
29
|
+
stage_cap[3] = stage_cap[2] + 0.1
|
32
30
|
else
|
33
|
-
stage_cap[0] = 66.0*1000.0
|
34
|
-
stage_cap[1] = 2.0*stage_cap[0]
|
35
|
-
if
|
36
|
-
stage_cap[2] = stage_cap[1]+0.1
|
37
|
-
stage_cap[3] = stage_cap[2]+0.1
|
38
|
-
elsif
|
39
|
-
stage_cap[2] = 3.0*stage_cap[0]
|
40
|
-
stage_cap[3] = stage_cap[2]+0.1
|
41
|
-
elsif
|
42
|
-
stage_cap[2] = 3.0*stage_cap[0]
|
43
|
-
stage_cap[3] = 4.0*stage_cap[0]
|
31
|
+
stage_cap[0] = 66.0 * 1000.0
|
32
|
+
stage_cap[1] = 2.0 * stage_cap[0]
|
33
|
+
if num_stages == 2
|
34
|
+
stage_cap[2] = stage_cap[1] + 0.1
|
35
|
+
stage_cap[3] = stage_cap[2] + 0.1
|
36
|
+
elsif num_stages == 3
|
37
|
+
stage_cap[2] = 3.0 * stage_cap[0]
|
38
|
+
stage_cap[3] = stage_cap[2] + 0.1
|
39
|
+
elsif num_stages == 4
|
40
|
+
stage_cap[2] = 3.0 * stage_cap[0]
|
41
|
+
stage_cap[3] = 4.0 * stage_cap[0]
|
44
42
|
end
|
45
43
|
end
|
46
44
|
# set capacities, flow rates, and sensible heat ratio for stages
|
47
|
-
|
45
|
+
(0..3).each do |istage|
|
48
46
|
htg_stages[istage].setNominalCapacity(stage_cap[istage])
|
49
47
|
end
|
50
48
|
# PLF vs PLR curve
|
@@ -52,14 +50,12 @@ class OpenStudio::Model::CoilHeatingGasMultiStage
|
|
52
50
|
end
|
53
51
|
|
54
52
|
# plf vs plr curve for furnace
|
55
|
-
furnace_plffplr_curve =
|
53
|
+
furnace_plffplr_curve = model.add_curve(furnace_plffplr_curve_name, standards)
|
56
54
|
if furnace_plffplr_curve
|
57
|
-
|
55
|
+
setPartLoadFractionCorrelationCurve(furnace_plffplr_curve)
|
58
56
|
else
|
59
|
-
OpenStudio
|
57
|
+
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingGasMultiStage', "For #{name}, cannot find plffplr curve, will not be set.")
|
60
58
|
successfully_set_all_properties = false
|
61
59
|
end
|
62
|
-
|
63
60
|
end
|
64
|
-
|
65
61
|
end
|
@@ -1,75 +1,71 @@
|
|
1
1
|
|
2
2
|
# Reopen the OpenStudio class to add methods to apply standards to this object
|
3
3
|
class OpenStudio::Model::Construction
|
4
|
-
|
5
4
|
# Sets the U-value of a construction to a specified value
|
6
5
|
# by modifying the thickness of the insulation layer.
|
7
6
|
#
|
8
7
|
# @param target_u_value_ip [Double] U-Value (Btu/ft^2*hr*R)
|
9
8
|
# @param insulation_layer_name [String] The name of the insulation layer in this construction
|
10
|
-
# @param intended_surface_type [String]
|
11
|
-
# Valid choices: 'AtticFloor', 'AtticWall', 'AtticRoof', 'DemisingFloor', 'InteriorFloor', 'InteriorCeiling',
|
9
|
+
# @param intended_surface_type [String]
|
10
|
+
# Valid choices: 'AtticFloor', 'AtticWall', 'AtticRoof', 'DemisingFloor', 'InteriorFloor', 'InteriorCeiling',
|
12
11
|
# 'DemisingWall', 'InteriorWall', 'InteriorPartition', 'InteriorWindow', 'InteriorDoor', 'DemisingRoof',
|
13
|
-
# 'ExteriorRoof', 'Skylight', 'TubularDaylightDome', 'TubularDaylightDiffuser', 'ExteriorFloor',
|
12
|
+
# 'ExteriorRoof', 'Skylight', 'TubularDaylightDome', 'TubularDaylightDiffuser', 'ExteriorFloor',
|
14
13
|
# 'ExteriorWall', 'ExteriorWindow', 'ExteriorDoor', 'GlassDoor', 'OverheadDoor', 'GroundContactFloor',
|
15
14
|
# 'GroundContactWall', 'GroundContactRoof'
|
16
15
|
# @param target_includes_film_coefficients [Bool] if true, subtracts off standard film coefficients from your
|
17
|
-
# target_u_value before modifying insulation thickness. Film values from 90.1-2010 A9.4.1 Air Films
|
16
|
+
# target_u_value before modifying insulation thickness. Film values from 90.1-2010 A9.4.1 Air Films
|
18
17
|
# @return [Bool] returns true if successful, false if not
|
19
18
|
# @todo Put in Phlyroy's logic for inferring the insulation layer of a construction
|
20
|
-
def set_u_value(target_u_value_ip, insulation_layer_name = nil, intended_surface_type = 'ExteriorWall',
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
def set_u_value(target_u_value_ip, insulation_layer_name = nil, intended_surface_type = 'ExteriorWall', target_includes_film_coefficients = true)
|
20
|
+
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.ConstructionBase', "Setting U-Value for #{name}.")
|
21
|
+
|
24
22
|
# Skip fenestration constructions
|
25
|
-
if
|
26
|
-
OpenStudio
|
23
|
+
if isFenestration
|
24
|
+
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ConstructionBase', "Can only set the u-value of opaque constructions. #{name} is not opaque.")
|
27
25
|
return false
|
28
26
|
end
|
29
|
-
|
27
|
+
|
30
28
|
# Make sure an insulation layer was specified
|
31
29
|
if insulation_layer_name.nil? && target_u_value_ip == 0.0
|
32
30
|
# Do nothing if the construction already doesn't have an insulation layer
|
33
31
|
elsif insulation_layer_name.nil?
|
34
|
-
OpenStudio
|
32
|
+
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.ConstructionBase', "Requested U-value of #{target_u_value_ip} for #{name}, but this construction has no insulation layer specified. Requested U-value will not be set.")
|
35
33
|
return false
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
# Remove the insulation layer if the specified U-value is zero.
|
34
|
+
end
|
35
|
+
|
36
|
+
# Remove the insulation layer if the specified U-value is zero.
|
41
37
|
if target_u_value_ip == 0.0
|
42
38
|
layer_index = 0
|
43
|
-
|
39
|
+
layers.each do |layer|
|
44
40
|
break if layer.name.get == insulation_layer_name
|
45
41
|
layer_index += 1
|
46
42
|
end
|
47
|
-
|
43
|
+
eraseLayer(layer_index)
|
48
44
|
return true
|
49
45
|
end
|
50
|
-
|
46
|
+
|
51
47
|
# Convert the target U-value to SI
|
52
48
|
target_u_value_ip = target_u_value_ip.to_f
|
53
|
-
target_r_value_ip = 1.0/target_u_value_ip
|
54
|
-
|
49
|
+
target_r_value_ip = 1.0 / target_u_value_ip
|
50
|
+
|
55
51
|
target_u_value_si = OpenStudio.convert(target_u_value_ip, 'Btu/ft^2*hr*R', 'W/m^2*K').get
|
56
|
-
target_r_value_si = 1.0/target_u_value_si
|
57
|
-
|
58
|
-
OpenStudio
|
59
|
-
OpenStudio
|
60
|
-
OpenStudio
|
61
|
-
OpenStudio
|
62
|
-
OpenStudio
|
63
|
-
|
52
|
+
target_r_value_si = 1.0 / target_u_value_si
|
53
|
+
|
54
|
+
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.ConstructionBase', "#{name}.")
|
55
|
+
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.ConstructionBase', "---target_u_value_ip = #{target_u_value_ip.round(3)} for #{name}.")
|
56
|
+
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.ConstructionBase', "---target_r_value_ip = #{target_r_value_ip.round(2)} for #{name}.")
|
57
|
+
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.ConstructionBase', "---target_u_value_si = #{target_u_value_si.round(3)} for #{name}.")
|
58
|
+
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.ConstructionBase', "---target_r_value_si = #{target_r_value_si.round(2)} for #{name}.")
|
59
|
+
|
64
60
|
# Determine the R-value of the non-insulation layers
|
65
61
|
other_layer_r_value_si = 0.0
|
66
|
-
|
62
|
+
layers.each do |layer|
|
67
63
|
next if layer.to_OpaqueMaterial.empty?
|
68
64
|
next if layer.name.get == insulation_layer_name
|
69
65
|
other_layer_r_value_si += layer.to_OpaqueMaterial.get.thermalResistance
|
70
66
|
end
|
71
67
|
|
72
|
-
#
|
68
|
+
# TODO: - remove code below and use film_coefficients_u_value method instead
|
73
69
|
# Determine the R-value of the air films, if requested
|
74
70
|
# Film values from 90.1-2010 A9.4.1 Air Films
|
75
71
|
if target_includes_film_coefficients
|
@@ -124,13 +120,13 @@ class OpenStudio::Model::Construction
|
|
124
120
|
# This is the desired R-value of the insulation.
|
125
121
|
ins_r_value_si = target_r_value_si - other_layer_r_value_si
|
126
122
|
if ins_r_value_si <= 0.0
|
127
|
-
OpenStudio
|
123
|
+
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.ConstructionBase', "Requested U-value of #{target_u_value_ip} for #{name} is too low given the other materials in the construction; insulation layer will not be modified.")
|
128
124
|
return false
|
129
125
|
end
|
130
126
|
ins_r_value_ip = OpenStudio.convert(ins_r_value_si, 'm^2*K/W', 'ft^2*h*R/Btu').get
|
131
|
-
|
127
|
+
|
132
128
|
# Set the R-value of the insulation layer
|
133
|
-
|
129
|
+
layers.each do |layer|
|
134
130
|
next unless layer.name.get == insulation_layer_name
|
135
131
|
if layer.to_StandardOpaqueMaterial.is_initialized
|
136
132
|
layer = layer.to_StandardOpaqueMaterial.get
|
@@ -150,69 +146,66 @@ class OpenStudio::Model::Construction
|
|
150
146
|
break # Stop looking for the insulation layer once found
|
151
147
|
end
|
152
148
|
end
|
153
|
-
|
149
|
+
|
154
150
|
# Modify the construction name
|
155
|
-
|
156
|
-
|
151
|
+
setName("#{name} R-#{target_r_value_ip.round(2)}")
|
152
|
+
|
157
153
|
return true
|
158
|
-
|
159
154
|
end
|
160
155
|
|
161
156
|
# Set the F-Factor of a slab to a specified value.
|
162
157
|
# Assumes an unheated, fully insulated slab, and modifies
|
163
|
-
# the insulation layer according to the values from 90.1-2004
|
158
|
+
# the insulation layer according to the values from 90.1-2004
|
164
159
|
# Table A6.3 Assembly F-Factors for Slab-on-Grade Floors.
|
165
160
|
#
|
166
161
|
# @param target_f_factor_ip [Double] F-Factor
|
167
162
|
# @param insulation_layer_name [String] The name of the insulation layer in this construction
|
168
163
|
# @return [Bool] returns true if successful, false if not
|
169
164
|
def set_slab_f_factor(target_f_factor_ip, insulation_layer_name = nil)
|
170
|
-
|
171
165
|
# Regression from table A6.3 unheated, fully insulated slab
|
172
166
|
r_value_ip = 1.0248 * target_f_factor_ip**-2.186
|
173
|
-
u_value_ip = 1.0/r_value_ip
|
174
|
-
|
167
|
+
u_value_ip = 1.0 / r_value_ip
|
168
|
+
|
175
169
|
# Set the insulation U-value
|
176
170
|
set_u_value(u_value_ip, insulation_layer_name, 'GroundContactFloor', true)
|
177
|
-
|
171
|
+
|
178
172
|
# Modify the construction name
|
179
|
-
|
180
|
-
|
173
|
+
setName("#{name} F-#{target_f_factor_ip.round(3)}")
|
174
|
+
|
181
175
|
return true
|
182
|
-
|
183
176
|
end
|
184
177
|
|
185
178
|
# Set the C-Factor of an underground wall to a specified value.
|
186
179
|
# Assumes continuous exterior insulation and modifies
|
187
|
-
# the insulation layer according to the values from 90.1-2004
|
180
|
+
# the insulation layer according to the values from 90.1-2004
|
188
181
|
# Table A4.2 Assembly C-Factors for Below-Grade walls.
|
189
182
|
#
|
190
183
|
# @param target_c_factor_ip [Double] C-Factor
|
191
184
|
# @param insulation_layer_name [String] The name of the insulation layer in this construction
|
192
185
|
# @return [Bool] returns true if successful, false if not
|
193
186
|
def set_underground_wall_c_factor(target_c_factor_ip, insulation_layer_name = nil)
|
194
|
-
|
195
187
|
# Regression from table A4.2 continuous exterior insulation
|
196
188
|
r_value_ip = 0.775 * target_c_factor_ip**-1.067
|
197
|
-
u_value_ip = 1.0/r_value_ip
|
198
|
-
|
189
|
+
u_value_ip = 1.0 / r_value_ip
|
190
|
+
|
199
191
|
# Set the insulation U-value
|
200
192
|
set_u_value(u_value_ip, insulation_layer_name, 'GroundContactWall', true)
|
201
|
-
|
193
|
+
|
202
194
|
# Modify the construction name
|
203
|
-
|
204
|
-
|
195
|
+
setName("#{name} C-#{target_c_factor_ip.round(3)}")
|
196
|
+
|
205
197
|
return true
|
206
|
-
|
207
198
|
end
|
208
199
|
|
200
|
+
# Get the SHGC as calculated by EnergyPlus.
|
201
|
+
# Only applies to fenestration constructions.
|
202
|
+
# @return [Double] the SHGC as a decimal.
|
209
203
|
def calculated_solar_heat_gain_coefficient
|
210
|
-
|
211
|
-
construction_name = self.name.get.to_s
|
204
|
+
construction_name = name.get.to_s
|
212
205
|
|
213
206
|
shgc = nil
|
214
207
|
|
215
|
-
sql =
|
208
|
+
sql = model.sqlFile
|
216
209
|
|
217
210
|
if sql.is_initialized
|
218
211
|
sql = sql.get
|
@@ -229,7 +222,7 @@ class OpenStudio::Model::Construction
|
|
229
222
|
if row_id.is_initialized
|
230
223
|
row_id = row_id.get
|
231
224
|
else
|
232
|
-
OpenStudio
|
225
|
+
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.model.Model', "SHGC row ID not found for construction: #{construction_name}.")
|
233
226
|
row_id = 9999
|
234
227
|
end
|
235
228
|
|
@@ -241,32 +234,28 @@ class OpenStudio::Model::Construction
|
|
241
234
|
AND ColumnName='Glass SHGC'
|
242
235
|
AND RowName='#{row_id}'"
|
243
236
|
|
244
|
-
|
245
237
|
shgc = sql.execAndReturnFirstDouble(shgc_query)
|
246
238
|
|
247
|
-
if shgc.is_initialized
|
248
|
-
|
249
|
-
|
250
|
-
shgc = nil
|
251
|
-
end
|
239
|
+
shgc = if shgc.is_initialized
|
240
|
+
shgc.get
|
241
|
+
end
|
252
242
|
|
253
243
|
else
|
254
|
-
OpenStudio
|
244
|
+
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Construction', 'Model has no sql file containing results, cannot lookup data.')
|
255
245
|
end
|
256
246
|
|
257
247
|
return shgc
|
258
|
-
|
259
248
|
end
|
260
249
|
|
261
|
-
# Get the VT as calculated by EnergyPlus
|
262
|
-
#
|
250
|
+
# Get the VT as calculated by EnergyPlus.
|
251
|
+
# Only applies to fenestration constructions.
|
252
|
+
# @return [Double] the visible transmittance as a decimal.
|
263
253
|
def calculated_visible_transmittance
|
264
|
-
|
265
|
-
construction_name = self.name.get.to_s
|
254
|
+
construction_name = name.get.to_s
|
266
255
|
|
267
256
|
vt = nil
|
268
257
|
|
269
|
-
sql =
|
258
|
+
sql = model.sqlFile
|
270
259
|
|
271
260
|
if sql.is_initialized
|
272
261
|
sql = sql.get
|
@@ -283,7 +272,7 @@ class OpenStudio::Model::Construction
|
|
283
272
|
if row_id.is_initialized
|
284
273
|
row_id = row_id.get
|
285
274
|
else
|
286
|
-
OpenStudio
|
275
|
+
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.model.Model', "VT row ID not found for construction: #{construction_name}.")
|
287
276
|
row_id = 9999
|
288
277
|
end
|
289
278
|
|
@@ -295,32 +284,28 @@ class OpenStudio::Model::Construction
|
|
295
284
|
AND ColumnName='Glass Visible Transmittance'
|
296
285
|
AND RowName='#{row_id}'"
|
297
286
|
|
298
|
-
|
299
287
|
vt = sql.execAndReturnFirstDouble(vt_query)
|
300
288
|
|
301
|
-
if vt.is_initialized
|
302
|
-
|
303
|
-
|
304
|
-
vt = nil
|
305
|
-
end
|
289
|
+
vt = if vt.is_initialized
|
290
|
+
vt.get
|
291
|
+
end
|
306
292
|
|
307
293
|
else
|
308
|
-
OpenStudio
|
294
|
+
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Space', 'Model has no sql file containing results, cannot lookup data.')
|
309
295
|
end
|
310
296
|
|
311
297
|
return vt
|
312
|
-
|
313
298
|
end
|
314
299
|
|
315
|
-
# Get the U-Factor as calculated by EnergyPlus
|
316
|
-
#
|
300
|
+
# Get the U-Factor as calculated by EnergyPlus.
|
301
|
+
# Only applies to fenestration constructions.
|
302
|
+
# @return [Double] the U-Factor in W/m^2*K.
|
317
303
|
def calculated_u_factor
|
318
|
-
|
319
|
-
construction_name = self.name.get.to_s
|
304
|
+
construction_name = name.get.to_s
|
320
305
|
|
321
306
|
u_factor_w_per_m2_k = nil
|
322
307
|
|
323
|
-
sql =
|
308
|
+
sql = model.sqlFile
|
324
309
|
|
325
310
|
if sql.is_initialized
|
326
311
|
sql = sql.get
|
@@ -337,7 +322,7 @@ class OpenStudio::Model::Construction
|
|
337
322
|
if row_id.is_initialized
|
338
323
|
row_id = row_id.get
|
339
324
|
else
|
340
|
-
OpenStudio
|
325
|
+
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.model.Model', "U-Factor row ID not found for construction: #{construction_name}.")
|
341
326
|
row_id = 9999
|
342
327
|
end
|
343
328
|
|
@@ -349,27 +334,29 @@ class OpenStudio::Model::Construction
|
|
349
334
|
AND ColumnName='Glass U-Factor'
|
350
335
|
AND RowName='#{row_id}'"
|
351
336
|
|
352
|
-
|
353
337
|
u_factor_w_per_m2_k = sql.execAndReturnFirstDouble(u_factor_query)
|
354
338
|
|
355
|
-
if u_factor_w_per_m2_k.is_initialized
|
356
|
-
|
357
|
-
|
358
|
-
u_factor_w_per_m2_k = nil
|
359
|
-
end
|
339
|
+
u_factor_w_per_m2_k = if u_factor_w_per_m2_k.is_initialized
|
340
|
+
u_factor_w_per_m2_k.get
|
341
|
+
end
|
360
342
|
|
361
343
|
else
|
362
|
-
OpenStudio
|
344
|
+
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Space', 'Model has no sql file containing results, cannot lookup data.')
|
363
345
|
end
|
364
346
|
|
365
347
|
return u_factor_w_per_m2_k
|
366
|
-
|
367
348
|
end
|
368
349
|
|
369
|
-
#
|
370
|
-
#
|
350
|
+
# Returns the R-value of the combined inside and outside
|
351
|
+
# air film values from 90.1-2010 A9.4.1 Air Films
|
352
|
+
# @param intended_surface_type [String]
|
353
|
+
# Valid choices: 'AtticFloor', 'AtticWall', 'AtticRoof', 'DemisingFloor', 'InteriorFloor', 'InteriorCeiling',
|
354
|
+
# 'DemisingWall', 'InteriorWall', 'InteriorPartition', 'InteriorWindow', 'InteriorDoor', 'DemisingRoof',
|
355
|
+
# 'ExteriorRoof', 'Skylight', 'TubularDaylightDome', 'TubularDaylightDiffuser', 'ExteriorFloor',
|
356
|
+
# 'ExteriorWall', 'ExteriorWindow', 'ExteriorDoor', 'GlassDoor', 'OverheadDoor', 'GroundContactFloor',
|
357
|
+
# 'GroundContactWall', 'GroundContactRoof'
|
358
|
+
# @return [double] r-value in m^2*K/W.
|
371
359
|
def film_coefficients_r_value(intended_surface_type)
|
372
|
-
|
373
360
|
other_layer_r_value_si = 0.0
|
374
361
|
|
375
362
|
# Determine the R-value of the air films, if requested
|
@@ -387,41 +374,38 @@ class OpenStudio::Model::Construction
|
|
387
374
|
fil_int_surf_vertical_r_si = OpenStudio.convert(fil_int_surf_vertical_r_ip, 'ft^2*hr*R/Btu', 'm^2*K/W').get
|
388
375
|
|
389
376
|
case intended_surface_type
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
377
|
+
when 'AtticFloor'
|
378
|
+
other_layer_r_value_si += film_int_surf_ht_flow_up_r_si # Outside
|
379
|
+
other_layer_r_value_si += film_semi_ext_surf_r_si # Inside
|
380
|
+
when 'AtticWall', 'AtticRoof'
|
381
|
+
other_layer_r_value_si += film_ext_surf_r_si # Outside
|
382
|
+
other_layer_r_value_si += film_semi_ext_surf_r_si # Inside
|
383
|
+
when 'DemisingFloor', 'InteriorFloor'
|
384
|
+
other_layer_r_value_si += film_int_surf_ht_flow_up_r_si # Outside
|
385
|
+
other_layer_r_value_si += film_int_surf_ht_flow_dwn_r_si # Inside
|
386
|
+
when 'InteriorCeiling'
|
387
|
+
other_layer_r_value_si += film_int_surf_ht_flow_dwn_r_si # Outside
|
388
|
+
other_layer_r_value_si += film_int_surf_ht_flow_up_r_si # Inside
|
389
|
+
when 'DemisingWall', 'InteriorWall', 'InteriorPartition', 'InteriorWindow', 'InteriorDoor'
|
390
|
+
other_layer_r_value_si += fil_int_surf_vertical_r_si # Outside
|
391
|
+
other_layer_r_value_si += fil_int_surf_vertical_r_si # Inside
|
392
|
+
when 'DemisingRoof', 'ExteriorRoof', 'Skylight', 'TubularDaylightDome', 'TubularDaylightDiffuser'
|
393
|
+
other_layer_r_value_si += film_ext_surf_r_si # Outside
|
394
|
+
other_layer_r_value_si += film_int_surf_ht_flow_up_r_si # Inside
|
395
|
+
when 'ExteriorFloor'
|
396
|
+
other_layer_r_value_si += film_ext_surf_r_si # Outside
|
397
|
+
other_layer_r_value_si += film_int_surf_ht_flow_dwn_r_si # Inside
|
398
|
+
when 'ExteriorWall', 'ExteriorWindow', 'ExteriorDoor', 'GlassDoor', 'OverheadDoor'
|
399
|
+
other_layer_r_value_si += film_ext_surf_r_si # Outside
|
400
|
+
other_layer_r_value_si += fil_int_surf_vertical_r_si # Inside
|
401
|
+
when 'GroundContactFloor'
|
402
|
+
other_layer_r_value_si += film_int_surf_ht_flow_dwn_r_si # Inside
|
403
|
+
when 'GroundContactWall'
|
404
|
+
other_layer_r_value_si += fil_int_surf_vertical_r_si # Inside
|
405
|
+
when 'GroundContactRoof'
|
406
|
+
other_layer_r_value_si += film_int_surf_ht_flow_up_r_si # Inside
|
420
407
|
end
|
421
408
|
|
422
|
-
|
423
409
|
return other_layer_r_value_si
|
424
|
-
|
425
410
|
end
|
426
|
-
|
427
411
|
end
|