openstudio-workflow 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +89 -77
- data/README.md +67 -93
- data/Rakefile +36 -36
- data/lib/openstudio-workflow.rb +65 -65
- data/lib/openstudio/workflow/adapters/input/local.rb +311 -324
- data/lib/openstudio/workflow/adapters/output/local.rb +158 -161
- data/lib/openstudio/workflow/adapters/output/socket.rb +106 -107
- data/lib/openstudio/workflow/adapters/output/web.rb +82 -82
- data/lib/openstudio/workflow/adapters/output_adapter.rb +163 -163
- data/lib/openstudio/workflow/job.rb +57 -57
- data/lib/openstudio/workflow/jobs/resources/monthly_report.idf +222 -222
- data/lib/openstudio/workflow/jobs/run_energyplus.rb +70 -70
- data/lib/openstudio/workflow/jobs/run_ep_measures.rb +73 -73
- data/lib/openstudio/workflow/jobs/run_initialization.rb +203 -203
- data/lib/openstudio/workflow/jobs/run_os_measures.rb +89 -89
- data/lib/openstudio/workflow/jobs/run_postprocess.rb +73 -73
- data/lib/openstudio/workflow/jobs/run_preprocess.rb +104 -104
- data/lib/openstudio/workflow/jobs/run_reporting_measures.rb +118 -118
- data/lib/openstudio/workflow/jobs/run_translation.rb +84 -84
- data/lib/openstudio/workflow/multi_delegator.rb +62 -62
- data/lib/openstudio/workflow/registry.rb +172 -172
- data/lib/openstudio/workflow/run.rb +342 -328
- data/lib/openstudio/workflow/time_logger.rb +96 -96
- data/lib/openstudio/workflow/util.rb +49 -49
- data/lib/openstudio/workflow/util/energyplus.rb +575 -605
- data/lib/openstudio/workflow/util/io.rb +68 -68
- data/lib/openstudio/workflow/util/measure.rb +658 -650
- data/lib/openstudio/workflow/util/model.rb +151 -151
- data/lib/openstudio/workflow/util/post_process.rb +235 -238
- data/lib/openstudio/workflow/util/weather_file.rb +143 -143
- data/lib/openstudio/workflow/version.rb +40 -40
- data/lib/openstudio/workflow_json.rb +475 -476
- data/lib/openstudio/workflow_runner.rb +263 -268
- metadata +24 -24
@@ -1,96 +1,96 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
3
|
-
# All rights reserved.
|
4
|
-
# Redistribution and use in source and binary forms, with or without
|
5
|
-
# modification, are permitted provided that the following conditions are met:
|
6
|
-
#
|
7
|
-
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
-
# this list of conditions and the following disclaimer.
|
9
|
-
#
|
10
|
-
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer in the documentation
|
12
|
-
# and/or other materials provided with the distribution.
|
13
|
-
#
|
14
|
-
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
-
# may be used to endorse or promote products derived from this software without
|
16
|
-
# specific prior written permission from the respective party.
|
17
|
-
#
|
18
|
-
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
-
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
-
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
-
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
-
#
|
23
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
-
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
-
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
-
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
-
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
-
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
-
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
-
# *******************************************************************************
|
35
|
-
|
36
|
-
# Class to store run times in a useful structure. Data are stored in a hash based on a the channel name
|
37
|
-
# There is no concept of multi-levels. The onus is on the user to make sure that they don't add a value to the
|
38
|
-
# logger that may be a level.
|
39
|
-
class TimeLogger
|
40
|
-
attr_reader :channels
|
41
|
-
|
42
|
-
def initialize
|
43
|
-
@logger = []
|
44
|
-
@channels = {}
|
45
|
-
end
|
46
|
-
|
47
|
-
# name of the moniker that you are tracking. If the name is already in use, then it restarts the timer.
|
48
|
-
def start(channel)
|
49
|
-
# warning -- "will reset timer for #{moniker}" if @monikers.key? moniker
|
50
|
-
s = ::Time.now
|
51
|
-
@channels[channel] = { start_time_str: s.to_s, start_time: s.to_f }
|
52
|
-
end
|
53
|
-
|
54
|
-
def stop(channel)
|
55
|
-
end_time = ::Time.now.to_f
|
56
|
-
@logger << {
|
57
|
-
channel: channel,
|
58
|
-
start_time: @channels[channel][:start_time],
|
59
|
-
start_time_str: @channels[channel][:start_time_str],
|
60
|
-
end_time: end_time,
|
61
|
-
delta: end_time - @channels[channel][:start_time]
|
62
|
-
}
|
63
|
-
|
64
|
-
# remove the channel
|
65
|
-
@channels.delete(channel) if @channels.key? channel
|
66
|
-
end
|
67
|
-
|
68
|
-
def stop_all
|
69
|
-
@channels.each_key do |channel|
|
70
|
-
stop(channel)
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
# return the entire report
|
75
|
-
def report
|
76
|
-
@logger
|
77
|
-
end
|
78
|
-
|
79
|
-
# this will report all the values for all the channels with this name.
|
80
|
-
def delta(channel)
|
81
|
-
@logger.map { |k| { channel.to_s => k[:delta] } if k[:channel] == channel }.compact
|
82
|
-
end
|
83
|
-
|
84
|
-
# save the data to a file. This will overwrite the file if it already exists
|
85
|
-
def save(filename)
|
86
|
-
File.open(filename, 'w') do |f|
|
87
|
-
f << JSON.pretty_generate(@logger)
|
88
|
-
# make sure data is written to the disk one way or the other
|
89
|
-
begin
|
90
|
-
f.fsync
|
91
|
-
rescue
|
92
|
-
f.flush
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
1
|
+
# *******************************************************************************
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
|
3
|
+
# All rights reserved.
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
+
# may be used to endorse or promote products derived from this software without
|
16
|
+
# specific prior written permission from the respective party.
|
17
|
+
#
|
18
|
+
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
+
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
+
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
+
#
|
23
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
+
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
+
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
# *******************************************************************************
|
35
|
+
|
36
|
+
# Class to store run times in a useful structure. Data are stored in a hash based on a the channel name
|
37
|
+
# There is no concept of multi-levels. The onus is on the user to make sure that they don't add a value to the
|
38
|
+
# logger that may be a level.
|
39
|
+
class TimeLogger
|
40
|
+
attr_reader :channels
|
41
|
+
|
42
|
+
def initialize
|
43
|
+
@logger = []
|
44
|
+
@channels = {}
|
45
|
+
end
|
46
|
+
|
47
|
+
# name of the moniker that you are tracking. If the name is already in use, then it restarts the timer.
|
48
|
+
def start(channel)
|
49
|
+
# warning -- "will reset timer for #{moniker}" if @monikers.key? moniker
|
50
|
+
s = ::Time.now
|
51
|
+
@channels[channel] = { start_time_str: s.to_s, start_time: s.to_f }
|
52
|
+
end
|
53
|
+
|
54
|
+
def stop(channel)
|
55
|
+
end_time = ::Time.now.to_f
|
56
|
+
@logger << {
|
57
|
+
channel: channel,
|
58
|
+
start_time: @channels[channel][:start_time],
|
59
|
+
start_time_str: @channels[channel][:start_time_str],
|
60
|
+
end_time: end_time,
|
61
|
+
delta: end_time - @channels[channel][:start_time]
|
62
|
+
}
|
63
|
+
|
64
|
+
# remove the channel
|
65
|
+
@channels.delete(channel) if @channels.key? channel
|
66
|
+
end
|
67
|
+
|
68
|
+
def stop_all
|
69
|
+
@channels.each_key do |channel|
|
70
|
+
stop(channel)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# return the entire report
|
75
|
+
def report
|
76
|
+
@logger
|
77
|
+
end
|
78
|
+
|
79
|
+
# this will report all the values for all the channels with this name.
|
80
|
+
def delta(channel)
|
81
|
+
@logger.map { |k| { channel.to_s => k[:delta] } if k[:channel] == channel }.compact
|
82
|
+
end
|
83
|
+
|
84
|
+
# save the data to a file. This will overwrite the file if it already exists
|
85
|
+
def save(filename)
|
86
|
+
File.open(filename, 'w') do |f|
|
87
|
+
f << JSON.pretty_generate(@logger)
|
88
|
+
# make sure data is written to the disk one way or the other
|
89
|
+
begin
|
90
|
+
f.fsync
|
91
|
+
rescue StandardError
|
92
|
+
f.flush
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -1,49 +1,49 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
3
|
-
# All rights reserved.
|
4
|
-
# Redistribution and use in source and binary forms, with or without
|
5
|
-
# modification, are permitted provided that the following conditions are met:
|
6
|
-
#
|
7
|
-
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
-
# this list of conditions and the following disclaimer.
|
9
|
-
#
|
10
|
-
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer in the documentation
|
12
|
-
# and/or other materials provided with the distribution.
|
13
|
-
#
|
14
|
-
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
-
# may be used to endorse or promote products derived from this software without
|
16
|
-
# specific prior written permission from the respective party.
|
17
|
-
#
|
18
|
-
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
-
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
-
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
-
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
-
#
|
23
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
-
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
-
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
-
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
-
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
-
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
-
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
-
# *******************************************************************************
|
35
|
-
|
36
|
-
module OpenStudio
|
37
|
-
module Workflow
|
38
|
-
# Hard load utils for the moment
|
39
|
-
#
|
40
|
-
module Util
|
41
|
-
require 'openstudio/workflow/util/io'
|
42
|
-
require 'openstudio/workflow/util/measure'
|
43
|
-
require 'openstudio/workflow/util/weather_file'
|
44
|
-
require 'openstudio/workflow/util/model'
|
45
|
-
require 'openstudio/workflow/util/energyplus'
|
46
|
-
require 'openstudio/workflow/util/post_process'
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
1
|
+
# *******************************************************************************
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
|
3
|
+
# All rights reserved.
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
+
# may be used to endorse or promote products derived from this software without
|
16
|
+
# specific prior written permission from the respective party.
|
17
|
+
#
|
18
|
+
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
+
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
+
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
+
#
|
23
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
+
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
+
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
# *******************************************************************************
|
35
|
+
|
36
|
+
module OpenStudio
|
37
|
+
module Workflow
|
38
|
+
# Hard load utils for the moment
|
39
|
+
#
|
40
|
+
module Util
|
41
|
+
require 'openstudio/workflow/util/io'
|
42
|
+
require 'openstudio/workflow/util/measure'
|
43
|
+
require 'openstudio/workflow/util/weather_file'
|
44
|
+
require 'openstudio/workflow/util/model'
|
45
|
+
require 'openstudio/workflow/util/energyplus'
|
46
|
+
require 'openstudio/workflow/util/post_process'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -1,605 +1,575 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
3
|
-
# All rights reserved.
|
4
|
-
# Redistribution and use in source and binary forms, with or without
|
5
|
-
# modification, are permitted provided that the following conditions are met:
|
6
|
-
#
|
7
|
-
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
-
# this list of conditions and the following disclaimer.
|
9
|
-
#
|
10
|
-
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer in the documentation
|
12
|
-
# and/or other materials provided with the distribution.
|
13
|
-
#
|
14
|
-
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
-
# may be used to endorse or promote products derived from this software without
|
16
|
-
# specific prior written permission from the respective party.
|
17
|
-
#
|
18
|
-
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
-
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
-
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
-
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
-
#
|
23
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
-
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
-
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
-
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
-
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
-
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
-
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
-
# *******************************************************************************
|
35
|
-
|
36
|
-
module OpenStudio
|
37
|
-
module Workflow
|
38
|
-
module Util
|
39
|
-
# The methods needed to run simulations using EnergyPlus are stored here. See the run_simulation class for
|
40
|
-
# implementation details.
|
41
|
-
module EnergyPlus
|
42
|
-
require 'openstudio/workflow/util/io'
|
43
|
-
include OpenStudio::Workflow::Util::IO
|
44
|
-
ENERGYPLUS_REGEX = /^energyplus\D{0,4}$/i
|
45
|
-
EXPAND_OBJECTS_REGEX = /^expandobjects\D{0,4}$/i
|
46
|
-
|
47
|
-
# Find the installation directory of EnergyPlus linked to the OpenStudio version being used
|
48
|
-
#
|
49
|
-
# @return [String] Returns the path to EnergyPlus
|
50
|
-
#
|
51
|
-
def find_energyplus
|
52
|
-
path = OpenStudio.getEnergyPlusDirectory.to_s
|
53
|
-
raise 'Unable to find the EnergyPlus executable' unless File.exist? path
|
54
|
-
path
|
55
|
-
end
|
56
|
-
|
57
|
-
# Does something
|
58
|
-
#
|
59
|
-
# @param [String] run_directory Directory to run the EnergyPlus simulation in
|
60
|
-
# @param [Array] energyplus_files Array of files containing the EnergyPlus and ExpandObjects EXEs
|
61
|
-
# @return [Void]
|
62
|
-
#
|
63
|
-
def clean_directory(run_directory, energyplus_files, logger)
|
64
|
-
logger.info 'Removing any copied EnergyPlus files'
|
65
|
-
energyplus_files.each do |file|
|
66
|
-
if File.exist? file
|
67
|
-
FileUtils.rm_f file
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
paths_to_rm = []
|
72
|
-
paths_to_rm << "#{run_directory}/packaged_measures"
|
73
|
-
paths_to_rm << "#{run_directory}/Energy+.ini"
|
74
|
-
paths_to_rm.each { |p| FileUtils.rm_rf(p) if File.exist?(p) }
|
75
|
-
end
|
76
|
-
|
77
|
-
# Prepare the directory to run EnergyPlus
|
78
|
-
#
|
79
|
-
# @param [String] run_directory Directory to copy the required EnergyPlus files to
|
80
|
-
# @param [Object] logger Logger object
|
81
|
-
# @param [String] energyplus_path Path to the EnergyPlus EXE
|
82
|
-
# @return [Array, file, file] Returns an array of strings of EnergyPlus files copied to the run_directory, the
|
83
|
-
# ExpandObjects EXE file, and EnergyPlus EXE file
|
84
|
-
#
|
85
|
-
def prepare_energyplus_dir(run_directory, logger, energyplus_path = nil)
|
86
|
-
logger.info "Copying EnergyPlus files to run directory: #{run_directory}"
|
87
|
-
energyplus_path ||= find_energyplus
|
88
|
-
logger.info "EnergyPlus path is #{energyplus_path}"
|
89
|
-
energyplus_files = []
|
90
|
-
energyplus_exe, expand_objects_exe = nil
|
91
|
-
Dir["#{energyplus_path}/*"].each do |file|
|
92
|
-
next if File.directory? file
|
93
|
-
|
94
|
-
# copy idd and ini files
|
95
|
-
if File.extname(file).downcase =~ /.idd|.ini/
|
96
|
-
dest_file = "#{run_directory}/#{File.basename(file)}"
|
97
|
-
energyplus_files << dest_file
|
98
|
-
FileUtils.copy file, dest_file
|
99
|
-
end
|
100
|
-
|
101
|
-
energyplus_exe = file if File.basename(file) =~ ENERGYPLUS_REGEX
|
102
|
-
expand_objects_exe = file if File.basename(file) =~ EXPAND_OBJECTS_REGEX
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
raise "Could not find
|
107
|
-
|
108
|
-
|
109
|
-
logger.info "
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
# @param [Object]
|
122
|
-
# @
|
123
|
-
#
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
Dir.
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
command
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
FileUtils.mv('
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
#
|
154
|
-
command
|
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
|
-
error_count
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
log_message
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
needs_sqlobj
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
new_objects << 'Output:Meter:MeterFileOnly,
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
new_objects << 'Output:Meter,
|
247
|
-
new_objects << 'Output:Meter,
|
248
|
-
|
249
|
-
new_objects
|
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
|
-
end
|
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
|
-
end
|
333
|
-
end
|
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
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
386
|
-
|
387
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
388
|
-
|
389
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
390
|
-
|
391
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
392
|
-
|
393
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
394
|
-
|
395
|
-
SumOrAverage
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
402
|
-
|
403
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
404
|
-
|
405
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
406
|
-
|
407
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
408
|
-
|
409
|
-
SumOrAverage
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
416
|
-
|
417
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
418
|
-
|
419
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
420
|
-
|
421
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
422
|
-
WaterSystems:
|
423
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter
|
424
|
-
Cogeneration:
|
425
|
-
SumOrAverage; !- Aggregation Type for Variable or Meter
|
426
|
-
|
427
|
-
Output:Table:Monthly,
|
428
|
-
Building Energy Performance - District
|
429
|
-
2, !- Digits After Decimal
|
430
|
-
InteriorLights:
|
431
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 1
|
432
|
-
ExteriorLights:
|
433
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 2
|
434
|
-
InteriorEquipment:
|
435
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 3
|
436
|
-
ExteriorEquipment:
|
437
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 4
|
438
|
-
Fans:
|
439
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 5
|
440
|
-
Pumps:
|
441
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 6
|
442
|
-
Heating:
|
443
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 7
|
444
|
-
Cooling:
|
445
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 8
|
446
|
-
HeatRejection:
|
447
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 9
|
448
|
-
Humidifier:
|
449
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 10
|
450
|
-
HeatRecovery:
|
451
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 11
|
452
|
-
WaterSystems:
|
453
|
-
SumOrAverage, !- Aggregation Type for Variable or Meter 12
|
454
|
-
Cogeneration:
|
455
|
-
SumOrAverage; !- Aggregation Type for Variable or Meter 13
|
456
|
-
|
457
|
-
Output:Table:Monthly,
|
458
|
-
Building Energy Performance -
|
459
|
-
2, !- Digits After Decimal
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
496
|
-
|
497
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
498
|
-
|
499
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
500
|
-
|
501
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
502
|
-
|
503
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
504
|
-
|
505
|
-
ValueWhenMaximumOrMinimum
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
514
|
-
|
515
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
516
|
-
|
517
|
-
ValueWhenMaximumOrMinimum
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
526
|
-
|
527
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
528
|
-
|
529
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
530
|
-
|
531
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
532
|
-
|
533
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
534
|
-
|
535
|
-
ValueWhenMaximumOrMinimum
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
546
|
-
|
547
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
548
|
-
|
549
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
550
|
-
|
551
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
552
|
-
|
553
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
554
|
-
|
555
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
556
|
-
|
557
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
558
|
-
|
559
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
560
|
-
|
561
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
562
|
-
|
563
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
564
|
-
|
565
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter
|
566
|
-
|
567
|
-
ValueWhenMaximumOrMinimum
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
ExteriorLights:DistrictCooling, !- Variable or Meter 2 Name
|
577
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 2
|
578
|
-
InteriorEquipment:DistrictCooling, !- Variable or Meter 3 Name
|
579
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 3
|
580
|
-
ExteriorEquipment:DistrictCooling, !- Variable or Meter 4 Name
|
581
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 4
|
582
|
-
Fans:DistrictCooling, !- Variable or Meter 5 Name
|
583
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 5
|
584
|
-
Pumps:DistrictCooling, !- Variable or Meter 6 Name
|
585
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 6
|
586
|
-
Heating:DistrictCooling, !- Variable or Meter 7 Name
|
587
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 7
|
588
|
-
Cooling:DistrictCooling, !- Variable or Meter 8 Name
|
589
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 8
|
590
|
-
HeatRejection:DistrictCooling, !- Variable or Meter 9 Name
|
591
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 9
|
592
|
-
Humidifier:DistrictCooling, !- Variable or Meter 10 Name
|
593
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 10
|
594
|
-
HeatRecovery:DistrictCooling,!- Variable or Meter 11 Name
|
595
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 11
|
596
|
-
WaterSystems:DistrictCooling,!- Variable or Meter 12 Name
|
597
|
-
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 12
|
598
|
-
Cogeneration:DistrictCooling,!- Variable or Meter 13 Name
|
599
|
-
ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 13
|
600
|
-
HEREDOC
|
601
|
-
end
|
602
|
-
end
|
603
|
-
end
|
604
|
-
end
|
605
|
-
end
|
1
|
+
# *******************************************************************************
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
|
3
|
+
# All rights reserved.
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
+
# may be used to endorse or promote products derived from this software without
|
16
|
+
# specific prior written permission from the respective party.
|
17
|
+
#
|
18
|
+
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
+
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
+
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
+
#
|
23
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
+
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
+
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
# *******************************************************************************
|
35
|
+
|
36
|
+
module OpenStudio
|
37
|
+
module Workflow
|
38
|
+
module Util
|
39
|
+
# The methods needed to run simulations using EnergyPlus are stored here. See the run_simulation class for
|
40
|
+
# implementation details.
|
41
|
+
module EnergyPlus
|
42
|
+
require 'openstudio/workflow/util/io'
|
43
|
+
include OpenStudio::Workflow::Util::IO
|
44
|
+
ENERGYPLUS_REGEX = /^energyplus\D{0,4}$/i
|
45
|
+
EXPAND_OBJECTS_REGEX = /^expandobjects\D{0,4}$/i
|
46
|
+
|
47
|
+
# Find the installation directory of EnergyPlus linked to the OpenStudio version being used
|
48
|
+
#
|
49
|
+
# @return [String] Returns the path to EnergyPlus
|
50
|
+
#
|
51
|
+
def find_energyplus
|
52
|
+
path = OpenStudio.getEnergyPlusDirectory.to_s
|
53
|
+
raise 'Unable to find the EnergyPlus executable' unless File.exist? path
|
54
|
+
path
|
55
|
+
end
|
56
|
+
|
57
|
+
# Does something
|
58
|
+
#
|
59
|
+
# @param [String] run_directory Directory to run the EnergyPlus simulation in
|
60
|
+
# @param [Array] energyplus_files Array of files containing the EnergyPlus and ExpandObjects EXEs
|
61
|
+
# @return [Void]
|
62
|
+
#
|
63
|
+
def clean_directory(run_directory, energyplus_files, logger)
|
64
|
+
logger.info 'Removing any copied EnergyPlus files'
|
65
|
+
energyplus_files.each do |file|
|
66
|
+
if File.exist? file
|
67
|
+
FileUtils.rm_f file
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
paths_to_rm = []
|
72
|
+
paths_to_rm << "#{run_directory}/packaged_measures"
|
73
|
+
paths_to_rm << "#{run_directory}/Energy+.ini"
|
74
|
+
paths_to_rm.each { |p| FileUtils.rm_rf(p) if File.exist?(p) }
|
75
|
+
end
|
76
|
+
|
77
|
+
# Prepare the directory to run EnergyPlus
|
78
|
+
#
|
79
|
+
# @param [String] run_directory Directory to copy the required EnergyPlus files to
|
80
|
+
# @param [Object] logger Logger object
|
81
|
+
# @param [String] energyplus_path Path to the EnergyPlus EXE
|
82
|
+
# @return [Array, file, file] Returns an array of strings of EnergyPlus files copied to the run_directory, the
|
83
|
+
# ExpandObjects EXE file, and EnergyPlus EXE file
|
84
|
+
#
|
85
|
+
def prepare_energyplus_dir(run_directory, logger, energyplus_path = nil)
|
86
|
+
logger.info "Copying EnergyPlus files to run directory: #{run_directory}"
|
87
|
+
energyplus_path ||= find_energyplus
|
88
|
+
logger.info "EnergyPlus path is #{energyplus_path}"
|
89
|
+
energyplus_files = []
|
90
|
+
energyplus_exe, expand_objects_exe = nil
|
91
|
+
Dir["#{energyplus_path}/*"].each do |file|
|
92
|
+
next if File.directory? file
|
93
|
+
|
94
|
+
# copy idd and ini files
|
95
|
+
if File.extname(file).downcase =~ /.idd|.ini/
|
96
|
+
dest_file = "#{run_directory}/#{File.basename(file)}"
|
97
|
+
energyplus_files << dest_file
|
98
|
+
FileUtils.copy file, dest_file
|
99
|
+
end
|
100
|
+
|
101
|
+
energyplus_exe = file if File.basename(file) =~ ENERGYPLUS_REGEX
|
102
|
+
expand_objects_exe = file if File.basename(file) =~ EXPAND_OBJECTS_REGEX
|
103
|
+
end
|
104
|
+
|
105
|
+
raise "Could not find EnergyPlus executable in #{energyplus_path}" unless energyplus_exe
|
106
|
+
raise "Could not find ExpandObjects executable in #{energyplus_path}" unless expand_objects_exe
|
107
|
+
|
108
|
+
logger.info "EnergyPlus executable path is #{energyplus_exe}"
|
109
|
+
logger.info "ExpandObjects executable path is #{expand_objects_exe}"
|
110
|
+
|
111
|
+
return energyplus_files, energyplus_exe, expand_objects_exe
|
112
|
+
end
|
113
|
+
|
114
|
+
# Configures and executes the EnergyPlus simulation and checks to see if the simulation was successful
|
115
|
+
#
|
116
|
+
# @param [String] run_directory Directory to execute the EnergyPlus simulation in. It is assumed that this
|
117
|
+
# directory already has the IDF and weather file in it
|
118
|
+
# @param [String] energyplus_path (nil) Optional path to override the default path associated with the
|
119
|
+
# OpenStudio package being used
|
120
|
+
# @param [Object] output_adapter (nil) Optional output adapter to update
|
121
|
+
# @param [Object] logger (nil) Optional logger, will log to STDOUT if none provided
|
122
|
+
# @return [Void]
|
123
|
+
#
|
124
|
+
def call_energyplus(run_directory, energyplus_path = nil, output_adapter = nil, logger = nil, workflow_json = nil)
|
125
|
+
logger ||= ::Logger.new(STDOUT) unless logger
|
126
|
+
|
127
|
+
current_dir = Dir.pwd
|
128
|
+
energyplus_path ||= find_energyplus
|
129
|
+
logger.info "EnergyPlus path is #{energyplus_path}"
|
130
|
+
energyplus_files, energyplus_exe, expand_objects_exe = prepare_energyplus_dir(run_directory, logger, energyplus_path)
|
131
|
+
Dir.chdir(run_directory)
|
132
|
+
logger.info "Starting simulation in run directory: #{Dir.pwd}"
|
133
|
+
|
134
|
+
if !@options[:skip_expand_objects]
|
135
|
+
command = popen_command("\"#{expand_objects_exe}\"")
|
136
|
+
logger.info "Running command '#{command}'"
|
137
|
+
File.open('stdout-expandobject', 'w') do |file|
|
138
|
+
::IO.popen(command) do |io|
|
139
|
+
while (line = io.gets)
|
140
|
+
file << line
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Check if expand objects did anything
|
146
|
+
if File.exist? 'expanded.idf'
|
147
|
+
FileUtils.mv('in.idf', 'pre-expand.idf', force: true) if File.exist?('in.idf')
|
148
|
+
FileUtils.mv('expanded.idf', 'in.idf', force: true)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# create stdout
|
153
|
+
command = popen_command("\"#{energyplus_exe}\" 2>&1")
|
154
|
+
logger.info "Running command '#{command}'"
|
155
|
+
File.open('stdout-energyplus', 'w') do |file|
|
156
|
+
::IO.popen(command) do |io|
|
157
|
+
while (line = io.gets)
|
158
|
+
file << line
|
159
|
+
output_adapter.communicate_energyplus_stdout(line) if output_adapter
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
r = $?
|
164
|
+
|
165
|
+
logger.info "EnergyPlus returned '#{r}'"
|
166
|
+
unless r.to_i.zero?
|
167
|
+
logger.warn 'EnergyPlus returned a non-zero exit code. Check the stdout-energyplus log.'
|
168
|
+
end
|
169
|
+
|
170
|
+
if File.exist? 'eplusout.err'
|
171
|
+
eplus_err = File.read('eplusout.err').force_encoding('ISO-8859-1').encode('utf-8', replace: nil)
|
172
|
+
|
173
|
+
if workflow_json
|
174
|
+
begin
|
175
|
+
if !@options[:fast]
|
176
|
+
workflow_json.setEplusoutErr(eplus_err)
|
177
|
+
end
|
178
|
+
rescue StandardError => e
|
179
|
+
# older versions of OpenStudio did not have the setEplusoutErr method
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
if eplus_err =~ /EnergyPlus Terminated--Fatal Error Detected/
|
184
|
+
raise 'EnergyPlus Terminated with a Fatal Error. Check eplusout.err log.'
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
if File.exist? 'eplusout.end'
|
189
|
+
f = File.read('eplusout.end').force_encoding('ISO-8859-1').encode('utf-8', replace: nil)
|
190
|
+
warnings_count = f[/(\d*).Warning/, 1]
|
191
|
+
error_count = f[/(\d*).Severe.Errors/, 1]
|
192
|
+
logger.info "EnergyPlus finished with #{warnings_count} warnings and #{error_count} severe errors"
|
193
|
+
if f =~ /EnergyPlus Terminated--Fatal Error Detected/
|
194
|
+
raise 'EnergyPlus Terminated with a Fatal Error. Check eplusout.err log.'
|
195
|
+
end
|
196
|
+
else
|
197
|
+
raise 'EnergyPlus failed and did not create an eplusout.end file. Check the stdout-energyplus log.'
|
198
|
+
end
|
199
|
+
rescue StandardError => e
|
200
|
+
log_message = "#{__FILE__} failed with #{e.message}, #{e.backtrace.join("\n")}"
|
201
|
+
logger.error log_message
|
202
|
+
raise log_message
|
203
|
+
ensure
|
204
|
+
logger.info "Ensuring 'clean' directory"
|
205
|
+
clean_directory(run_directory, energyplus_files, logger)
|
206
|
+
|
207
|
+
Dir.chdir(current_dir)
|
208
|
+
logger.info 'EnergyPlus Completed'
|
209
|
+
end
|
210
|
+
|
211
|
+
# Run this code before running EnergyPlus to make sure the reporting variables are setup correctly
|
212
|
+
#
|
213
|
+
# @param [Object] idf The IDF Workspace to be simulated
|
214
|
+
# @return [Void]
|
215
|
+
#
|
216
|
+
def energyplus_preprocess(idf, logger)
|
217
|
+
logger.info 'Running EnergyPlus Preprocess'
|
218
|
+
|
219
|
+
new_objects = []
|
220
|
+
|
221
|
+
needs_sqlobj = idf.getObjectsByType('Output:SQLite'.to_IddObjectType).empty?
|
222
|
+
|
223
|
+
if needs_sqlobj
|
224
|
+
# just add this, we don't allow this type in add_energyplus_output_request
|
225
|
+
logger.info 'Adding SQL Output to IDF'
|
226
|
+
object = OpenStudio::IdfObject.load('Output:SQLite,SimpleAndTabular;').get
|
227
|
+
idf.addObjects(object)
|
228
|
+
end
|
229
|
+
|
230
|
+
# merge in monthly reports
|
231
|
+
EnergyPlus.monthly_report_idf_text.split(/^[\s]*$/).each do |object|
|
232
|
+
object = object.strip
|
233
|
+
next if object.empty?
|
234
|
+
|
235
|
+
new_objects << object
|
236
|
+
end
|
237
|
+
|
238
|
+
# These are needed for the calibration report
|
239
|
+
new_objects << 'Output:Meter:MeterFileOnly,Gas:Facility,Daily;'
|
240
|
+
new_objects << 'Output:Meter:MeterFileOnly,Electricity:Facility,Timestep;'
|
241
|
+
new_objects << 'Output:Meter:MeterFileOnly,Electricity:Facility,Daily;'
|
242
|
+
|
243
|
+
# Always add in the timestep facility meters
|
244
|
+
new_objects << 'Output:Meter,Electricity:Facility,Timestep;'
|
245
|
+
new_objects << 'Output:Meter,Gas:Facility,Timestep;'
|
246
|
+
new_objects << 'Output:Meter,DistrictCooling:Facility,Timestep;'
|
247
|
+
new_objects << 'Output:Meter,DistrictHeating:Facility,Timestep;'
|
248
|
+
|
249
|
+
new_objects.each do |obj|
|
250
|
+
object = OpenStudio::IdfObject.load(obj).get
|
251
|
+
OpenStudio::Workflow::Util::EnergyPlus.add_energyplus_output_request(idf, object)
|
252
|
+
end
|
253
|
+
|
254
|
+
logger.info 'Finished EnergyPlus Preprocess'
|
255
|
+
end
|
256
|
+
|
257
|
+
# examines object and determines whether or not to add it to the workspace
|
258
|
+
def self.add_energyplus_output_request(workspace, idf_object)
|
259
|
+
num_added = 0
|
260
|
+
idd_object = idf_object.iddObject
|
261
|
+
|
262
|
+
allowed_objects = []
|
263
|
+
allowed_objects << 'Output:Surfaces:List'
|
264
|
+
allowed_objects << 'Output:Surfaces:Drawing'
|
265
|
+
allowed_objects << 'Output:Schedules'
|
266
|
+
allowed_objects << 'Output:Constructions'
|
267
|
+
allowed_objects << 'Output:Table:TimeBins'
|
268
|
+
allowed_objects << 'Output:Table:Monthly'
|
269
|
+
allowed_objects << 'Output:Variable'
|
270
|
+
allowed_objects << 'Output:Meter'
|
271
|
+
allowed_objects << 'Output:Meter:MeterFileOnly'
|
272
|
+
allowed_objects << 'Output:Meter:Cumulative'
|
273
|
+
allowed_objects << 'Output:Meter:Cumulative:MeterFileOnly'
|
274
|
+
allowed_objects << 'Meter:Custom'
|
275
|
+
allowed_objects << 'Meter:CustomDecrement'
|
276
|
+
allowed_objects << 'EnergyManagementSystem:OutputVariable'
|
277
|
+
|
278
|
+
if allowed_objects.include?(idd_object.name)
|
279
|
+
unless check_for_object(workspace, idf_object, idd_object.type)
|
280
|
+
workspace.addObject(idf_object)
|
281
|
+
num_added += 1
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
allowed_unique_objects = []
|
286
|
+
# allowed_unique_objects << "Output:EnergyManagementSystem" # TODO: have to merge
|
287
|
+
# allowed_unique_objects << "OutputControl:SurfaceColorScheme" # TODO: have to merge
|
288
|
+
allowed_unique_objects << 'Output:Table:SummaryReports' # TODO: have to merge
|
289
|
+
# OutputControl:Table:Style # not allowed
|
290
|
+
# OutputControl:ReportingTolerances # not allowed
|
291
|
+
# Output:SQLite # not allowed
|
292
|
+
|
293
|
+
if allowed_unique_objects.include?(idf_object.iddObject.name)
|
294
|
+
if idf_object.iddObject.name == 'Output:Table:SummaryReports'
|
295
|
+
summary_reports = workspace.getObjectsByType(idf_object.iddObject.type)
|
296
|
+
if summary_reports.empty?
|
297
|
+
workspace.addObject(idf_object)
|
298
|
+
num_added += 1
|
299
|
+
else
|
300
|
+
merge_output_table_summary_reports(summary_reports[0], idf_object)
|
301
|
+
end
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
305
|
+
return num_added
|
306
|
+
end
|
307
|
+
|
308
|
+
# check to see if we have an exact match for this object already
|
309
|
+
def self.check_for_object(workspace, idf_object, idd_object_type)
|
310
|
+
workspace.getObjectsByType(idd_object_type).each do |object|
|
311
|
+
# all of these objects fields are data fields
|
312
|
+
if idf_object.dataFieldsEqual(object)
|
313
|
+
return true
|
314
|
+
end
|
315
|
+
end
|
316
|
+
return false
|
317
|
+
end
|
318
|
+
|
319
|
+
# merge all summary reports that are not in the current workspace
|
320
|
+
def self.merge_output_table_summary_reports(current_object, new_object)
|
321
|
+
current_fields = []
|
322
|
+
current_object.extensibleGroups.each do |current_extensible_group|
|
323
|
+
current_fields << current_extensible_group.getString(0).to_s
|
324
|
+
end
|
325
|
+
|
326
|
+
fields_to_add = []
|
327
|
+
new_object.extensibleGroups.each do |new_extensible_group|
|
328
|
+
field = new_extensible_group.getString(0).to_s
|
329
|
+
unless current_fields.include?(field)
|
330
|
+
current_fields << field
|
331
|
+
fields_to_add << field
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
unless fields_to_add.empty?
|
336
|
+
fields_to_add.each do |field|
|
337
|
+
values = OpenStudio::StringVector.new
|
338
|
+
values << field
|
339
|
+
current_object.pushExtensibleGroup(values)
|
340
|
+
end
|
341
|
+
return true
|
342
|
+
end
|
343
|
+
|
344
|
+
return false
|
345
|
+
end
|
346
|
+
|
347
|
+
def self.monthly_report_idf_text
|
348
|
+
<<-HEREDOC
|
349
|
+
Output:Table:Monthly,
|
350
|
+
Building Energy Performance - Electricity, !- Name
|
351
|
+
2, !- Digits After Decimal
|
352
|
+
InteriorLights:Electricity, !- Variable or Meter 1 Name
|
353
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 1
|
354
|
+
ExteriorLights:Electricity, !- Variable or Meter 2 Name
|
355
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 2
|
356
|
+
InteriorEquipment:Electricity, !- Variable or Meter 3 Name
|
357
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 3
|
358
|
+
ExteriorEquipment:Electricity, !- Variable or Meter 4 Name
|
359
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 4
|
360
|
+
Fans:Electricity, !- Variable or Meter 5 Name
|
361
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 5
|
362
|
+
Pumps:Electricity, !- Variable or Meter 6 Name
|
363
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 6
|
364
|
+
Heating:Electricity, !- Variable or Meter 7 Name
|
365
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 7
|
366
|
+
Cooling:Electricity, !- Variable or Meter 8 Name
|
367
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 8
|
368
|
+
HeatRejection:Electricity, !- Variable or Meter 9 Name
|
369
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 9
|
370
|
+
Humidifier:Electricity, !- Variable or Meter 10 Name
|
371
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 10
|
372
|
+
HeatRecovery:Electricity,!- Variable or Meter 11 Name
|
373
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 11
|
374
|
+
WaterSystems:Electricity,!- Variable or Meter 12 Name
|
375
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 12
|
376
|
+
Cogeneration:Electricity,!- Variable or Meter 13 Name
|
377
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 13
|
378
|
+
Refrigeration:Electricity,!- Variable or Meter 14 Name
|
379
|
+
SumOrAverage; !- Aggregation Type for Variable or Meter 14
|
380
|
+
|
381
|
+
Output:Table:Monthly,
|
382
|
+
Building Energy Performance - Natural Gas, !- Name
|
383
|
+
2, !- Digits After Decimal
|
384
|
+
InteriorEquipment:Gas, !- Variable or Meter 1 Name
|
385
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 1
|
386
|
+
ExteriorEquipment:Gas, !- Variable or Meter 2 Name
|
387
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 2
|
388
|
+
Heating:Gas, !- Variable or Meter 3 Name
|
389
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 3
|
390
|
+
Cooling:Gas, !- Variable or Meter 4 Name
|
391
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 4
|
392
|
+
WaterSystems:Gas, !- Variable or Meter 5 Name
|
393
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 5
|
394
|
+
Cogeneration:Gas, !- Variable or Meter 6 Name
|
395
|
+
SumOrAverage; !- Aggregation Type for Variable or Meter 6
|
396
|
+
|
397
|
+
Output:Table:Monthly,
|
398
|
+
Building Energy Performance - District Heating, !- Name
|
399
|
+
2, !- Digits After Decimal
|
400
|
+
InteriorLights:DistrictHeating, !- Variable or Meter 1 Name
|
401
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 1
|
402
|
+
ExteriorLights:DistrictHeating, !- Variable or Meter 2 Name
|
403
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 2
|
404
|
+
InteriorEquipment:DistrictHeating, !- Variable or Meter 3 Name
|
405
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 3
|
406
|
+
ExteriorEquipment:DistrictHeating, !- Variable or Meter 4 Name
|
407
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 4
|
408
|
+
Fans:DistrictHeating, !- Variable or Meter 5 Name
|
409
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 5
|
410
|
+
Pumps:DistrictHeating, !- Variable or Meter 6 Name
|
411
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 6
|
412
|
+
Heating:DistrictHeating, !- Variable or Meter 7 Name
|
413
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 7
|
414
|
+
Cooling:DistrictHeating, !- Variable or Meter 8 Name
|
415
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 8
|
416
|
+
HeatRejection:DistrictHeating, !- Variable or Meter 9 Name
|
417
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 9
|
418
|
+
Humidifier:DistrictHeating, !- Variable or Meter 10 Name
|
419
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 10
|
420
|
+
HeatRecovery:DistrictHeating,!- Variable or Meter 11 Name
|
421
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 11
|
422
|
+
WaterSystems:DistrictHeating,!- Variable or Meter 12 Name
|
423
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 12
|
424
|
+
Cogeneration:DistrictHeating,!- Variable or Meter 13 Name
|
425
|
+
SumOrAverage; !- Aggregation Type for Variable or Meter 13
|
426
|
+
|
427
|
+
Output:Table:Monthly,
|
428
|
+
Building Energy Performance - District Cooling, !- Name
|
429
|
+
2, !- Digits After Decimal
|
430
|
+
InteriorLights:DistrictCooling, !- Variable or Meter 1 Name
|
431
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 1
|
432
|
+
ExteriorLights:DistrictCooling, !- Variable or Meter 2 Name
|
433
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 2
|
434
|
+
InteriorEquipment:DistrictCooling, !- Variable or Meter 3 Name
|
435
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 3
|
436
|
+
ExteriorEquipment:DistrictCooling, !- Variable or Meter 4 Name
|
437
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 4
|
438
|
+
Fans:DistrictCooling, !- Variable or Meter 5 Name
|
439
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 5
|
440
|
+
Pumps:DistrictCooling, !- Variable or Meter 6 Name
|
441
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 6
|
442
|
+
Heating:DistrictCooling, !- Variable or Meter 7 Name
|
443
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 7
|
444
|
+
Cooling:DistrictCooling, !- Variable or Meter 8 Name
|
445
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 8
|
446
|
+
HeatRejection:DistrictCooling, !- Variable or Meter 9 Name
|
447
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 9
|
448
|
+
Humidifier:DistrictCooling, !- Variable or Meter 10 Name
|
449
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 10
|
450
|
+
HeatRecovery:DistrictCooling,!- Variable or Meter 11 Name
|
451
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 11
|
452
|
+
WaterSystems:DistrictCooling,!- Variable or Meter 12 Name
|
453
|
+
SumOrAverage, !- Aggregation Type for Variable or Meter 12
|
454
|
+
Cogeneration:DistrictCooling,!- Variable or Meter 13 Name
|
455
|
+
SumOrAverage; !- Aggregation Type for Variable or Meter 13
|
456
|
+
|
457
|
+
Output:Table:Monthly,
|
458
|
+
Building Energy Performance - Electricity Peak Demand, !- Name
|
459
|
+
2, !- Digits After Decimal
|
460
|
+
Electricity:Facility, !- Variable or Meter 1 Name
|
461
|
+
Maximum, !- Aggregation Type for Variable or Meter 1
|
462
|
+
InteriorLights:Electricity, !- Variable or Meter 1 Name
|
463
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 1
|
464
|
+
ExteriorLights:Electricity, !- Variable or Meter 2 Name
|
465
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 2
|
466
|
+
InteriorEquipment:Electricity, !- Variable or Meter 3 Name
|
467
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 3
|
468
|
+
ExteriorEquipment:Electricity, !- Variable or Meter 4 Name
|
469
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 4
|
470
|
+
Fans:Electricity, !- Variable or Meter 5 Name
|
471
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 5
|
472
|
+
Pumps:Electricity, !- Variable or Meter 6 Name
|
473
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 6
|
474
|
+
Heating:Electricity, !- Variable or Meter 7 Name
|
475
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 7
|
476
|
+
Cooling:Electricity, !- Variable or Meter 8 Name
|
477
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 8
|
478
|
+
HeatRejection:Electricity, !- Variable or Meter 9 Name
|
479
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 9
|
480
|
+
Humidifier:Electricity, !- Variable or Meter 10 Name
|
481
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 10
|
482
|
+
HeatRecovery:Electricity,!- Variable or Meter 11 Name
|
483
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 11
|
484
|
+
WaterSystems:Electricity,!- Variable or Meter 12 Name
|
485
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 12
|
486
|
+
Cogeneration:Electricity,!- Variable or Meter 13 Name
|
487
|
+
ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 13
|
488
|
+
|
489
|
+
Output:Table:Monthly,
|
490
|
+
Building Energy Performance - Natural Gas Peak Demand, !- Name
|
491
|
+
2, !- Digits After Decimal
|
492
|
+
Gas:Facility, !- Variable or Meter 1 Name
|
493
|
+
Maximum, !- Aggregation Type for Variable or Meter 1
|
494
|
+
InteriorEquipment:Gas, !- Variable or Meter 1 Name
|
495
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 1
|
496
|
+
ExteriorEquipment:Gas, !- Variable or Meter 2 Name
|
497
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 2
|
498
|
+
Heating:Gas, !- Variable or Meter 3 Name
|
499
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 3
|
500
|
+
Cooling:Gas, !- Variable or Meter 4 Name
|
501
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 4
|
502
|
+
WaterSystems:Gas, !- Variable or Meter 5 Name
|
503
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 5
|
504
|
+
Cogeneration:Gas, !- Variable or Meter 6 Name
|
505
|
+
ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 6
|
506
|
+
|
507
|
+
Output:Table:Monthly,
|
508
|
+
Building Energy Performance - District Heating Peak Demand, !- Name
|
509
|
+
2, !- Digits After Decimal
|
510
|
+
DistrictHeating:Facility, !- Variable or Meter 1 Name
|
511
|
+
Maximum, !- Aggregation Type for Variable or Meter 1
|
512
|
+
InteriorLights:DistrictHeating, !- Variable or Meter 1 Name
|
513
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 1
|
514
|
+
ExteriorLights:DistrictHeating, !- Variable or Meter 2 Name
|
515
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 2
|
516
|
+
InteriorEquipment:DistrictHeating, !- Variable or Meter 3 Name
|
517
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 3
|
518
|
+
ExteriorEquipment:DistrictHeating, !- Variable or Meter 4 Name
|
519
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 4
|
520
|
+
Fans:DistrictHeating, !- Variable or Meter 5 Name
|
521
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 5
|
522
|
+
Pumps:DistrictHeating, !- Variable or Meter 6 Name
|
523
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 6
|
524
|
+
Heating:DistrictHeating, !- Variable or Meter 7 Name
|
525
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 7
|
526
|
+
Cooling:DistrictHeating, !- Variable or Meter 8 Name
|
527
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 8
|
528
|
+
HeatRejection:DistrictHeating, !- Variable or Meter 9 Name
|
529
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 9
|
530
|
+
Humidifier:DistrictHeating, !- Variable or Meter 10 Name
|
531
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 10
|
532
|
+
HeatRecovery:DistrictHeating,!- Variable or Meter 11 Name
|
533
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 11
|
534
|
+
WaterSystems:DistrictHeating,!- Variable or Meter 12 Name
|
535
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 12
|
536
|
+
Cogeneration:DistrictHeating,!- Variable or Meter 13 Name
|
537
|
+
ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 13
|
538
|
+
|
539
|
+
Output:Table:Monthly,
|
540
|
+
Building Energy Performance - District Cooling Peak Demand, !- Name
|
541
|
+
2, !- Digits After Decimal
|
542
|
+
DistrictCooling:Facility, !- Variable or Meter 1 Name
|
543
|
+
Maximum, !- Aggregation Type for Variable or Meter 1
|
544
|
+
InteriorLights:DistrictCooling, !- Variable or Meter 1 Name
|
545
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 1
|
546
|
+
ExteriorLights:DistrictCooling, !- Variable or Meter 2 Name
|
547
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 2
|
548
|
+
InteriorEquipment:DistrictCooling, !- Variable or Meter 3 Name
|
549
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 3
|
550
|
+
ExteriorEquipment:DistrictCooling, !- Variable or Meter 4 Name
|
551
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 4
|
552
|
+
Fans:DistrictCooling, !- Variable or Meter 5 Name
|
553
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 5
|
554
|
+
Pumps:DistrictCooling, !- Variable or Meter 6 Name
|
555
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 6
|
556
|
+
Heating:DistrictCooling, !- Variable or Meter 7 Name
|
557
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 7
|
558
|
+
Cooling:DistrictCooling, !- Variable or Meter 8 Name
|
559
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 8
|
560
|
+
HeatRejection:DistrictCooling, !- Variable or Meter 9 Name
|
561
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 9
|
562
|
+
Humidifier:DistrictCooling, !- Variable or Meter 10 Name
|
563
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 10
|
564
|
+
HeatRecovery:DistrictCooling,!- Variable or Meter 11 Name
|
565
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 11
|
566
|
+
WaterSystems:DistrictCooling,!- Variable or Meter 12 Name
|
567
|
+
ValueWhenMaximumOrMinimum, !- Aggregation Type for Variable or Meter 12
|
568
|
+
Cogeneration:DistrictCooling,!- Variable or Meter 13 Name
|
569
|
+
ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 13
|
570
|
+
HEREDOC
|
571
|
+
end
|
572
|
+
end
|
573
|
+
end
|
574
|
+
end
|
575
|
+
end
|