Class: Honeybee::ElectricLoadCenter

Inherits:
ModelObject show all
Defined in:
lib/honeybee/generator/loadcenter.rb,
lib/to_openstudio/generator/loadcenter.rb

Instance Attribute Summary

Attributes inherited from ModelObject

#errors, #openstudio_object, #warnings

Instance Method Summary collapse

Methods inherited from ModelObject

#allowable_types, clean_identifier, clean_name, #find_existing_openstudio_object, #initialize, #method_missing, read_from_disk, truncate

Constructor Details

This class inherits a constructor from Honeybee::ModelObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Honeybee::ModelObject

Instance Method Details

#defaultsObject



37
38
39
# File 'lib/honeybee/generator/loadcenter.rb', line 37

def defaults
  @@schema[:components][:schemas][:ElectricLoadCenter][:properties]
end

#to_openstudio(openstudio_model, generator_objects) ⇒ Object



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
# File 'lib/to_openstudio/generator/loadcenter.rb', line 39

def to_openstudio(openstudio_model, generator_objects)
  # create the ElectricLoadCenter:Distribution specification
  load_center = OpenStudio::Model::ElectricLoadCenterDistribution.new(openstudio_model)
  load_center.setName('Model Load Center Distribution')

  # add the generators to the specification
  generator_objects.each do |gen_obj|
    load_center.addGenerator(gen_obj)
  end

  # assign the major properties to the load center
  load_center.setGeneratorOperationSchemeType('Baseload')
  load_center.setElectricalBussType('DirectCurrentWithInverter')

  # create the inverter and assign it
  inverter = OpenStudio::Model::ElectricLoadCenterInverterPVWatts.new(openstudio_model)
  if @hash[:inverter_dc_to_ac_size_ratio]
    inverter.setDCToACSizeRatio(@hash[:inverter_dc_to_ac_size_ratio])
  else
    inverter.setDCToACSizeRatio(defaults[:inverter_dc_to_ac_size_ratio][:default])
  end
  if @hash[:inverter_efficiency]
    inverter.setInverterEfficiency(@hash[:inverter_efficiency])
  else
    inverter.setInverterEfficiency(defaults[:inverter_efficiency][:default])
  end
  load_center.setInverter(inverter)

  load_center
end