Class: RunEnergyPlus
- Inherits:
-
OpenStudio::Workflow::Job
- Object
- OpenStudio::Workflow::Job
- RunEnergyPlus
- Includes:
- OpenStudio::Workflow::Util::EnergyPlus
- Defined in:
- lib/openstudio/workflow/jobs/run_energyplus.rb
Overview
This class runs the EnergyPlus simulation
Constant Summary
Constants included from OpenStudio::Workflow::Util::EnergyPlus
OpenStudio::Workflow::Util::EnergyPlus::ENERGYPLUS_REGEX, OpenStudio::Workflow::Util::EnergyPlus::EXPAND_OBJECTS_REGEX
Instance Method Summary collapse
-
#initialize(input_adapter, output_adapter, registry, options = {}) ⇒ RunEnergyPlus
constructor
A new instance of RunEnergyPlus.
- #perform ⇒ Object
Methods included from OpenStudio::Workflow::Util::EnergyPlus
add_energyplus_output_request, #call_energyplus, check_for_object, #clean_directory, #energyplus_preprocess, #find_energyplus, merge_output_table_summary_reports, monthly_report_idf_text, #prepare_energyplus_dir
Methods included from OpenStudio::Workflow::Util::IO
Constructor Details
#initialize(input_adapter, output_adapter, registry, options = {}) ⇒ RunEnergyPlus
Returns a new instance of RunEnergyPlus.
43 44 45 |
# File 'lib/openstudio/workflow/jobs/run_energyplus.rb', line 43 def initialize(input_adapter, output_adapter, registry, = {}) super end |
Instance Method Details
#perform ⇒ Object
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 |
# File 'lib/openstudio/workflow/jobs/run_energyplus.rb', line 47 def perform @logger.debug "Calling #{__method__} in the #{self.class} class" # skip if halted halted = @registry[:runner].halted @logger.info 'Workflow halted, skipping the EnergyPlus simulation' if halted return nil if halted # Checks and configuration raise 'No run_dir specified in the registry' unless @registry[:run_dir] ep_path = [:energyplus_path] || nil @logger.warn "Using EnergyPlus path specified in options #{ep_path}" if ep_path @logger.info 'Starting the EnergyPlus simulation' @registry[:time_logger]&.start('Running EnergyPlus') call_energyplus(@registry[:run_dir], ep_path, @output_adapter, @logger, @registry[:workflow_json]) @registry[:time_logger]&.stop('Running EnergyPlus') @logger.info 'Completed the EnergyPlus simulation' sql_path = File.join(@registry[:run_dir], 'eplusout.sql') @registry.register(:sql) { sql_path } if File.exist? sql_path @logger.warn "Unable to find sql file at #{sql_path}" unless @registry[:sql] nil end |