class URBANopt::Reporting::DefaultReports::ThermalStorage

Ice Thermal Storage Systems

Attributes

its_size_kwh[RW]

Float - Total ice storage capacity on central plant loop in kWh

ptes_size_kwh[RW]

Float - Total ice storage capacity distributed to packaged systems in kWh

Public Class Methods

merge_thermal_storage(existing_tes, new_tes) click to toggle source

Merge thermal storage

# File lib/urbanopt/reporting/default_reports/thermal_storage.rb, line 77
def self.merge_thermal_storage(existing_tes, new_tes)
  existing_tes.its_size_kwh = add_values(existing_tes.its_size_kwh, new_tes.its_size_kwh)
  existing_tes.ptes_size_kwh = add_values(existing_tes.ptes_size_kwh, new_tes.ptes_size_kwh)

  return existing_tes
end
new(hash = {}) click to toggle source
# File lib/urbanopt/reporting/default_reports/thermal_storage.rb, line 26
def initialize(hash = {})
  hash.delete_if { |k, v| v.nil? }

  @its_size = hash[:its_size_kwh]
  @ptes_size = hash[:ptes_size_kwh]

  # initialize class variables @@validator and @@schema
  @@validator ||= Validator.new
  @@schema ||= @@validator.schema

  # initialize @@logger
  @@logger ||= URBANopt::Reporting::DefaultReports.logger
end

Public Instance Methods

defaults() click to toggle source

Assigns default values if attribute values do not exist.

# File lib/urbanopt/reporting/default_reports/thermal_storage.rb, line 43
def defaults
  hash = {}
  hash[:its_size_kwh] = nil
  hash[:ptes_size_kwh] = nil

  return hash
end
to_hash() click to toggle source

Convert to hash equivalent for JSON serialization

# File lib/urbanopt/reporting/default_reports/thermal_storage.rb, line 54
def to_hash
  result = {}
  result[:its_size_kwh] = @its_size_kwh if @its_size_kwh
  result[:ptes_size_kwh] = @ptes_size_kwh if @ptes_size_kwh

  return result
end