Skip to content

Commit 10e6453

Browse files
committed
Fix SQL column names
1 parent 2cbafa7 commit 10e6453

File tree

9 files changed

+413
-410
lines changed

9 files changed

+413
-410
lines changed

HardSizeHVACEquipment/resources/AirTerminalSingleDuctVAVReheat.rb

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ class OpenStudio::Model::AirTerminalSingleDuctVAVReheat
66
# and puts them into this object model in place of the autosized fields.
77
# Must have previously completed a run with sql output for this to work.
88
def applySizingValues
9-
9+
1010
rated_flow_rate = self.autosizedMaximumAirFlowRate
1111
if rated_flow_rate.is_initialized
12-
self.setMaximumAirFlowRate(rated_flow_rate.get)
12+
self.setMaximumAirFlowRate(rated_flow_rate.get)
1313
end
14-
14+
1515
maximum_hot_water_or_steam_flow_rate = self.autosizedMaximumHotWaterOrSteamFlowRate
1616
if maximum_hot_water_or_steam_flow_rate.is_initialized
1717
self.setMaximumHotWaterOrSteamFlowRate(maximum_hot_water_or_steam_flow_rate.get)
1818
end
19-
19+
2020
maximum_flow_per_zone_floor_area_during_reheat = self.autosizedMaximumFlowPerZoneFloorAreaDuringReheat
2121
if maximum_flow_per_zone_floor_area_during_reheat.is_initialized
22-
self.setMaximumFlowPerZoneFloorAreaDuringReheat(maximum_flow_per_zone_floor_area_during_reheat.get)
22+
self.setMaximumFlowPerZoneFloorAreaDuringReheat(maximum_flow_per_zone_floor_area_during_reheat.get)
2323
end
24-
24+
2525
maximum_flow_fraction_during_reheat = self.autosizedMaximumFlowFractionDuringReheat
2626
if maximum_flow_fraction_during_reheat.is_initialized
2727
self.setMaximumFlowFractionDuringReheat(maximum_flow_fraction_during_reheat.get)
@@ -35,33 +35,33 @@ def autosizedMaximumAirFlowRate
3535
result = OpenStudio::OptionalDouble.new()
3636

3737
name = self.name.get.upcase
38-
38+
3939
model = self.model
40-
40+
4141
sql = model.sqlFile
42-
42+
4343
if sql.is_initialized
4444
sql = sql.get
45-
46-
query = "SELECT Value
47-
FROM tabulardatawithstrings
48-
WHERE ReportName='ComponentSizingSummary'
49-
AND ReportForString='Entire Facility'
50-
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
51-
AND RowName='#{name}'
52-
AND ColumnName='Maximum Air Flow Rate'
45+
46+
query = "SELECT Value
47+
FROM tabulardatawithstrings
48+
WHERE ReportName='ComponentSizingSummary'
49+
AND ReportForString='Entire Facility'
50+
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
51+
AND RowName='#{name}'
52+
AND ColumnName='Design Size Maximum Air Flow Rate'
5353
AND Units='m3/s'"
54-
54+
5555
val = sql.execAndReturnFirstDouble(query)
56-
56+
5757
if val.is_initialized
5858
result = OpenStudio::OptionalDouble.new(val.get)
5959
end
60-
60+
6161
end
6262

6363
return result
64-
64+
6565
end
6666

6767
# returns the autosized rated power consumption as an optional double
@@ -70,105 +70,105 @@ def autosizedMaximumHotWaterOrSteamFlowRate
7070
result = OpenStudio::OptionalDouble.new()
7171

7272
name = self.name.get.upcase
73-
73+
7474
model = self.model
75-
75+
7676
sql = model.sqlFile
77-
77+
7878
if sql.is_initialized
7979
sql = sql.get
80-
81-
query = "SELECT Value
82-
FROM tabulardatawithstrings
83-
WHERE ReportName='ComponentSizingSummary'
84-
AND ReportForString='Entire Facility'
85-
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
86-
AND RowName='#{name}'
87-
AND ColumnName='Maximum Reheat Water Flow Rate'
80+
81+
query = "SELECT Value
82+
FROM tabulardatawithstrings
83+
WHERE ReportName='ComponentSizingSummary'
84+
AND ReportForString='Entire Facility'
85+
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
86+
AND RowName='#{name}'
87+
AND ColumnName='Design Size Maximum Reheat Water Flow Rate'
8888
AND Units='m3/s'"
89-
89+
9090
val = sql.execAndReturnFirstDouble(query)
91-
91+
9292
if val.is_initialized
9393
result = OpenStudio::OptionalDouble.new(val.get)
9494
end
95-
95+
9696
end
9797

9898
return result
99-
100-
end
101-
99+
100+
end
101+
102102
# returns the autosized maximum flow per zone floor area during reheat as an optional double
103103
def autosizedMaximumFlowPerZoneFloorAreaDuringReheat
104104

105105
result = OpenStudio::OptionalDouble.new()
106106

107107
name = self.name.get.upcase
108-
108+
109109
model = self.model
110-
110+
111111
sql = model.sqlFile
112-
112+
113113
if sql.is_initialized
114114
sql = sql.get
115-
116-
query = "SELECT Value
117-
FROM tabulardatawithstrings
118-
WHERE ReportName='ComponentSizingSummary'
119-
AND ReportForString='Entire Facility'
120-
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
121-
AND RowName='#{name}'
122-
AND ColumnName='Maximum Flow per Zone Floor Area during Reheat'
115+
116+
query = "SELECT Value
117+
FROM tabulardatawithstrings
118+
WHERE ReportName='ComponentSizingSummary'
119+
AND ReportForString='Entire Facility'
120+
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
121+
AND RowName='#{name}'
122+
AND ColumnName='Design Size Maximum Flow per Zone Floor Area during Reheat'
123123
AND Units='m3/s-m2'"
124-
124+
125125
val = sql.execAndReturnFirstDouble(query)
126-
126+
127127
if val.is_initialized
128128
result = OpenStudio::OptionalDouble.new(val.get)
129129
end
130-
130+
131131
end
132132

133133
return result
134-
135-
end
136-
134+
135+
end
136+
137137
# returns the autosized maximum flow fraction during reheat as an optional double
138138
def autosizedMaximumFlowFractionDuringReheat
139139

140140
result = OpenStudio::OptionalDouble.new()
141141

142142
name = self.name.get.upcase
143-
143+
144144
model = self.model
145-
145+
146146
sql = model.sqlFile
147-
147+
148148
if sql.is_initialized
149149
sql = sql.get
150-
151-
query = "SELECT Value
152-
FROM tabulardatawithstrings
153-
WHERE ReportName='ComponentSizingSummary'
154-
AND ReportForString='Entire Facility'
155-
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
156-
AND RowName='#{name}'
157-
AND ColumnName='Maximum Flow Fraction during Reheat'"
158-
150+
151+
query = "SELECT Value
152+
FROM tabulardatawithstrings
153+
WHERE ReportName='ComponentSizingSummary'
154+
AND ReportForString='Entire Facility'
155+
AND TableName='AirTerminal:SingleDuct:VAV:Reheat'
156+
AND RowName='#{name}'
157+
AND ColumnName='Design Size Maximum Flow Fraction during Reheat'"
158+
159159
val = sql.execAndReturnFirstDouble(query)
160-
160+
161161
if val.is_initialized
162162
result = OpenStudio::OptionalDouble.new(val.get)
163163
end
164-
164+
165165
end
166166

167167
return result
168-
169-
end
170-
171-
172168

173-
169+
end
170+
171+
172+
173+
174174
end

HardSizeHVACEquipment/resources/BoilerHotWater.rb

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ def applySizingValues
99

1010
nominal_capacity = self.autosizedNominalCapacity
1111
if nominal_capacity.is_initialized
12-
self.setNominalCapacity(nominal_capacity.get)
12+
self.setNominalCapacity(nominal_capacity.get)
1313
end
1414

1515
design_water_flow_rate = self.autosizedDesignWaterFlowRate
1616
if design_water_flow_rate.is_initialized
17-
self.setDesignWaterFlowRate(design_water_flow_rate.get)
17+
self.setDesignWaterFlowRate(design_water_flow_rate.get)
1818
end
19-
19+
2020
end
2121

2222
# returns the autosized nominal capacity as an optional double
@@ -25,69 +25,69 @@ def autosizedNominalCapacity
2525
result = OpenStudio::OptionalDouble.new()
2626

2727
name = self.name.get.upcase
28-
28+
2929
model = self.model
30-
30+
3131
sql = model.sqlFile
32-
32+
3333
if sql.is_initialized
3434
sql = sql.get
35-
36-
query = "SELECT Value
37-
FROM tabulardatawithstrings
38-
WHERE ReportName='ComponentSizingSummary'
39-
AND ReportForString='Entire Facility'
40-
AND TableName='Boiler:HotWater'
41-
AND RowName='#{name}'
42-
AND ColumnName='Nominal Capacity'
35+
36+
query = "SELECT Value
37+
FROM tabulardatawithstrings
38+
WHERE ReportName='ComponentSizingSummary'
39+
AND ReportForString='Entire Facility'
40+
AND TableName='Boiler:HotWater'
41+
AND RowName='#{name}'
42+
AND ColumnName='Design Size Nominal Capacity'
4343
AND Units='W'"
44-
44+
4545
val = sql.execAndReturnFirstDouble(query)
46-
46+
4747
if val.is_initialized
4848
result = OpenStudio::OptionalDouble.new(val.get)
4949
end
50-
50+
5151
end
5252

5353
return result
54-
54+
5555
end
56-
56+
5757
# returns the autosized design water flow rate as an optional double
5858
def autosizedDesignWaterFlowRate
5959

6060
result = OpenStudio::OptionalDouble.new()
6161

6262
name = self.name.get.upcase
63-
63+
6464
model = self.model
65-
65+
6666
sql = model.sqlFile
67-
67+
6868
if sql.is_initialized
6969
sql = sql.get
70-
71-
query = "SELECT Value
72-
FROM tabulardatawithstrings
73-
WHERE ReportName='ComponentSizingSummary'
74-
AND ReportForString='Entire Facility'
75-
AND TableName='Boiler:HotWater'
76-
AND RowName='#{name}'
77-
AND ColumnName='Design Water Flow Rate'
70+
71+
query = "SELECT Value
72+
FROM tabulardatawithstrings
73+
WHERE ReportName='ComponentSizingSummary'
74+
AND ReportForString='Entire Facility'
75+
AND TableName='Boiler:HotWater'
76+
AND RowName='#{name}'
77+
AND ColumnName='Design Size Design Water Flow Rate'
7878
AND Units='m3/s'"
79-
79+
8080
val = sql.execAndReturnFirstDouble(query)
81-
81+
8282
if val.is_initialized
8383
result = OpenStudio::OptionalDouble.new(val.get)
8484
end
85-
85+
8686
end
8787

8888
return result
89-
89+
9090
end
91-
92-
91+
92+
9393
end

0 commit comments

Comments
 (0)