-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenergy-intensity.php
More file actions
421 lines (379 loc) · 15.7 KB
/
energy-intensity.php
File metadata and controls
421 lines (379 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
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
420
421
<?php
require 'php/EEB_SQLITE3.php';
session_start();
$_SESSION['Model'][0]="baseline";
// define the sql file path
if ($_POST['num_package'] != NULL) {
$cur_model = $_SESSION['cur_model'] = $_POST['num_package'];
} elseif($_POST['num_package'] == NULL && $_SESSION['cur_model'] == NULL) {
$cur_model = $_SESSION['Model'][0];
} else {
$cur_model = $_SESSION['cur_model'];
}
if($cur_model != 'baseline'){
$user_dir = "$_SESSION[user_dir]/";
}
$sql_file="/ENERGYPLUS/EEMs/{$user_dir}{$cur_model}.idf/EnergyPlusPreProcess/EnergyPlus-0/eplusout.sql";
#$eeb = new EEB_SQLITE3('php/modified_V8_V720.sql');
$eeb = new EEB_SQLITE3("./$sql_file");
$total_vals = $eeb->getValues('AnnualBuildingUtilityPerformanceSummary', 'Entire Facility', 'Site and Source Energy', '%');
$site_vals = $eeb->getValues('AnnualBuildingUtilityPerformanceSummary', 'Entire Facility', 'End Uses', 'kBtu');
$source_vals = $eeb->getValues('SourceEnergyEndUseComponentsSummary', 'Entire Facility', 'Source Energy End Use Components Summary', 'kBtu');
$area_vals = $eeb->getValues('AnnualBuildingUtilityPerformanceSummary', 'Entire Facility', 'Building Area', '%');
//print_r($area_vals);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>EEB Hub Simulation Tools: Comprehensive</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<style>
body {
background: linear-gradient(to bottom, #999, #fff);
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
.container{
width: 90%;
}
.table-striped{
background: #eee;
}
.table{
text-align: center;
}
</style>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<!-- Navbar
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" >
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand pull-left" href="./">EEB Hub Simulation Platform</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="">
<a href="http://tools.eebhub.org/">Home</a>
</li>
<li class="">
<a href="http://tools.eebhub.org/">Lite</a>
</li>
<li class="">
<a href="http://tools.eebhub.org/">Partial</a>
</li>
<li class="">
<a href="http://tools.eebhub.org/substantial">Substantial</a>
</li>
<li class="active">
<a href="http://tools.eebhub.org/comprehensive">Comprehensive</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Container -->
<div class="container">
<!-- Switch Pacakge -->
<form action="" method="post">
<select id="num_package" name="num_package" onchange="this.form.submit();">
<?php
echo "<option value=\"$cur_model\">$cur_model</option>";
foreach( $_SESSION['Model'] as $eem_model ) {
echo "<option value=\"$eem_model\">$eem_model</option>";
}
?>
</select>
</form>
<!-- Sub-Nav-bar -->
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Open Studio SDK And Energy Plus</a>
<ul class="nav">
<li><a href="./energy-use.php">Energy Use</a></li>
<li><a href="./zone-component-load.php">Zone Component Load</a></li>
<li class="active"><a href="./energy-intensity.php">Energy Intensity</a></li>
<li><a href="./energy-cost.php">Energy Cost</a></li>
<li><a href="#">GHG Emissions</a></li>
<li><a href="tracking-sheet.php">Tracking Sheet</a></li>
<li><a href="eem_measure.php">EEM Measure List</a></li>
<li><a href="eem_scheduler.php">EEM Scheduler</a></li>
<li><a href="all-site-energy.php">EEM Model Example</a></li>
<li><a href="./summary.php">Summary</a></li>
</ul>
</div>
</div>
<!-- Energy Intensity div -->
<div>
<div id="annula_energy_chart" style="min-width: 400px; height: 400px; margin: 40px auto;"></div>
<table class="table table-striped table-bordered " style="margin: 40px auto; ">
<caption style="background: linear-gradient(to left, yellow, #3399ff, purple ); color: #fff; "> <h3>Annual Energy Consumption And Intensity<h3> </caption>
<?php
echo
<tr id='table-row-head'>
<th> -
</th>
<th> Total Electricity [kBtu]
</th>
<th> Total Natural Gas [kBtu]
</th>
<th> Total Energy [kBtu]
</th>
<th> Area [ft^2]
</th>
<th> Energy Per Total Building Area [kBtu/ft^2]
</th>
<th> Energy Per Conditioned Building Area [kBtu/ft^2]
</th>
</tr>
<tr class='table-row-even'>
<th> Total Site Energy
</th>
<td>".number_format($site_vals['Total End Uses']['Electricity']).
</td>
<td>".number_format($site_vals['Total End Uses']['Natural Gas']).
</td>
<td>".number_format($total_vals['Total Site Energy']['Total Energy']).
</td>
<td>".number_format($area_vals['Total Building Area']['Area']).
</td>
<td style='color:red'>".$total_vals['Total Site Energy']['Energy Per Total Building Area'].
</td>
<td>".$total_vals['Total Site Energy']['Energy Per Conditioned Building Area'].
</td>
</tr>
<tr class='table-row-even'>
<th> Total Source Energy
</th>
<td>".number_format($source_vals['Total Source Energy End Use Components']['Source Electricity']).
</td>
<td>".number_format($source_vals['Total Source Energy End Use Components']['Source Natural Gas']).
</td>
<td>".number_format($total_vals['Total Source Energy']['Total Energy']).
</td>
<td>".number_format($area_vals['Total Building Area']['Area']).
</td>
<td>".$total_vals['Total Source Energy']['Energy Per Total Building Area'].
</td>
<td>".$total_vals['Total Source Energy']['Energy Per Conditioned Building Area'].
</td>
</tr>";
?>
</table>
<div id="energy_per_total_building_area_chart" style="min-width: 400px; width: 50%; height: 500px; float: left;"></div>
<div id="energy_per_conditioned_building_area_chart" style="min-width: 400px; width: 50%; height: 500px; float: left; margin-bottom: 50px;"></div>
</div>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- load highchart libs -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="js/Highcharts-3.0.4/js/highcharts.js"></script>
<script src="js/Highcharts-3.0.4/js/modules/exporting.js"></script>
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- Charts' Defination -->
<script>
// Annual Total Site and Source Energy
$(function () {
$('#annula_energy_chart').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Annual Site and Source Energy Consumption (kBtu)'
},
xAxis: {
categories: ['Total Site Energy', 'Total Source Energy' ]
},
yAxis: {
min: 0,
title: {
text: 'Energy Consumption (kBtu)'
}
},
legend: {
backgroundColor: '#FFFFFF',
reversed: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
<?php
echo
series: [{
name: 'Pumps',
color: "orange",
data: [{$site_vals['Pumps']['Electricity']}, {$source_vals['Pumps']['Source Electricity']}]
}, {
name: 'Fans',
color: 'black',
data: [{$site_vals['Fans']['Electricity']}, {$source_vals['Fans']['Source Electricity']}]
}, {
name: 'Cooling',
color: 'green',
data: [{$site_vals['Cooling']['Electricity']}, {$source_vals['Cooling']['Source Electricity']}]
}, {
name: 'Heating-Natural-Gas',
color: 'red',
data: [{$site_vals['Heating']['Natural Gas']}, {$source_vals['Heating']['Source Natural Gas']}]
}, {
name: 'Iterior Lighting',
color: '#3388ff',
data: [{$site_vals['Interior Lighting']['Electricity']}, {$source_vals['Interior Lighting']['Source Electricity']}]
}, {
name: 'Interior Equipment',
color: 'purple',
data: [{$site_vals['Interior Equipment']['Electricity']}, {$source_vals['Interior Equipment']['Source Electricity']}]
}, {
name: 'Exterior Lighting',
visible: false,
data: [{$site_vals['Exterior Lighting']['Electricity']}, {$source_vals['Exterior Lighting']['Source Electricity']}]
}, {
name: 'Heating-Electricity',
visible: false,
data: [{$site_vals['Heating']['Electricity']}, {$source_vals['Heating']['Source Electricity']}]
}, {
name: 'Exterior Equipment',
visible: false,
data: [{$site_vals['Exterior Equipment']['Electricity']}, {$source_vals['Exterior Equipment']['Source Electricity']}]
}, {
name: 'Heating Rejecation',
visible: false,
data: [{$site_vals['Heating Rejecation']['Electricity']}, {$source_vals['Heating Rejecation']['Source Electricity']}]
}, {
name: 'Humidification',
visible: false,
data: [{$site_vals['Humidification']['Electricity']}, {$source_vals['Humidification']['Source Electricity']}]
}, {
name: 'Heat Recovery',
visible: false,
data: [{$site_vals['Heat Recovery']['Electricity']}, {$source_vals['Heat Recovery']['Source Electricity']}]
}, {
name: 'Water Systems',
visible: false,
data: [{$site_vals['Water Systems']['Electricity']}, {$source_vals['Water Systems']['Source Electricity']}]
}, {
name: 'Refrigeration',
visible: false,
data: [{$site_vals['Refrigeration']['Electricity']}, {$source_vals['Refrigeration']['Source Electricity']}]
}, {
name: 'Generations',
visible: false,
data: [{$site_vals['Generations']['Electricity']}, {$source_vals['Generations']['Source Electricity']}]
}]
END;
?>
});
});
$(function () {
$('#energy_per_total_building_area_chart').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Energy Per Total Building Area (kBtu/ft2)'
},
xAxis: {
categories: ['Total Site Energy', 'Total Source Energy' ]
},
yAxis: {
min: 0,
title: {
text: 'Energy Consumption (kBtu/ft2)'
}
},
legend: {
backgroundColor: '#FFFFFF',
reversed: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
<?php
$site_ele_intensity = $site_vals['Total End Uses']['Electricity'] / $area_vals['Total Building Area']['Area'];
$site_gas_intensity = $site_vals['Total End Uses']['Natural Gas'] / $area_vals['Total Building Area']['Area'];
$source_ele_intensity = $source_vals['Total Source Energy End Use Components']['Source Electricity'] / $area_vals['Total Building Area']['Area'];
$source_gas_intensity = $source_vals['Total Source Energy End Use Components']['Source Natural Gas'] / $area_vals['Total Building Area']['Area'];
echo
series: [{
name: 'Electricity',
data: [$site_ele_intensity, $source_ele_intensity]
}, {
name: 'Natural Gas',
color: 'red',
data: [$site_gas_intensity, $source_gas_intensity]
}]
END;
?>
});
});
$(function () {
$('#energy_per_conditioned_building_area_chart').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Energy Per Conditioned Building Area (kBtu/ft2s)'
},
xAxis: {
categories: ['Total Site Energy', 'Total Source Energy' ]
},
yAxis: {
min: 0,
title: {
text: 'Energy Consumption (kBtu/ft2)'
}
},
legend: {
backgroundColor: '#FFFFFF',
reversed: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
<?php
$site_ele_intensity = $site_vals['Total End Uses']['Electricity'] / $area_vals['Net Conditioned Building Area']['Area'];
$site_gas_intensity = $site_vals['Total End Uses']['Natural Gas'] / $area_vals['Net Conditioned Building Area']['Area'];
$source_ele_intensity = $source_vals['Total Source Energy End Use Components']['Source Electricity'] / $area_vals['Net Conditioned Building Area']['Area'];
$source_gas_intensity = $source_vals['Total Source Energy End Use Components']['Source Natural Gas'] / $area_vals['Net Conditioned Building Area']['Area'];
echo
series: [{
name: 'Electricity',
data: [$site_ele_intensity, $source_ele_intensity]
}, {
name: 'Natural Gas',
color: 'red',
data: [$site_gas_intensity, $source_gas_intensity]
}]
END;
?>
});
});
</script>
</body>
</html>