Class: Vintagizer

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio-standards/btap/vintagizer.rb

Overview

To change this template, choose Tools | Templates and open the template in the editor.

Instance Method Summary collapse

Constructor Details

#initialize(model, file, selectionHash) ⇒ Vintagizer

This method loads Vintage database information.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

  • file (String)
  • selectionHash (???)

Author:



30
31
32
# File 'lib/openstudio-standards/btap/vintagizer.rb', line 30

def initialize(model,file,selectionHash)
  #Load Vintage database information.
end

Instance Method Details

#copObject

This method will set the coiling coil COP



152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/openstudio-standards/btap/vintagizer.rb', line 152

def cop()
  #DX Coil COP ECMs
  unless 'default' == cop_info[1]
    constructions_model.getCoilCoolingDXSingleSpeeds.sort.each do |cooling_coil|
      cooling_coil.setRatedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ) )
    end
    constructions_model.getCoilCoolingDXTwoSpeeds.sort.each do |cooling_coil|
      cooling_coil.setRatedHighSpeedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ) )
      cooling_coil.setRatedLowSpeedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ) )
    end
  end
end

#envelope(construction_file, construction_set_name, vintage, building_type, climate_zone) ⇒ String

This method will (????).

Parameters:

Returns:

Author:



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
# File 'lib/openstudio-standards/btap/vintagizer.rb', line 42

def envelope(construction_file,construction_set_name,vintage,building_type,climate_zone)

  #Load Construction Lib set. "C:/OSRuby/Resources/DND/Trenton/TrentonConstructionsLibrary.osm"
  construction_lib = BTAP::FileIO::load_osm(construction_file)
  #Create temp model library.
  library = BTAP::FileIO::load_osm("C:/OSRuby/Resources/DOEArchetypes/blank.osm", "blank")
  #get construction set by type and vintage.. I/O expensive so doing it here.
  vintage_construction_set = construction_lib.getDefaultConstructionSetByName("#{ construction_type[0] }#{ vintage }").get
  
  #Construct name for new construction set.
  construction_id = "#{construction_type[0]}-#{vintage}-#{wall_retrofit[0]}-#{roof_retrofit[0]}-#{glazing_retrofit[0]}"

  new_construction_set =vintage_construction_set.clone(library).to_DefaultConstructionSet.get
  
  new_construction_set =vintage_construction_set.clone(library).to_DefaultConstructionSet.get
  #Set conductances to needed values in construction set if possible.
  BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
    library,
    construction_id,
    new_construction_set,
    1.0 / ext_wall_ecm_info[0], 
    1.0 / ext_roof_ecm_info[0], 
    1.0 / ext_roof_ecm_info[0],
    1.0 / ground_cond[0], 
    1.0 / ground_cond[0], 
    1.0 / ground_cond[0],
    glazing_ecm_info[0], 
    glazing_ecm_info[1],  
    glazing_ecm_info[2],
    glazing_ecm_info[0], 
    glazing_ecm_info[1],  
    glazing_ecm_info[2]
  )
  
  
  #Define costs
  BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_costs(new_construction_set,
    ext_wall_ecm_info[1],
    ext_roof_ecm_info[1],
    ext_roof_ecm_info[1],
    ground_cond[1],
    ground_cond[1],
    ground_cond[1],
    glazing_ecm_info[3],
    glazing_ecm_info[3],
    0.0, #doors
    0.0, #glass doors
    0.0, #overhead doors
    0.0, #skylight
    0.0, #tubular_daylight_dome_cost =
    0.0 #tubular_daylight_diffuser_cost
  )
  
  
  #Remove all existing constructions from model.
  BTAP::Resources::Envelope::remove_all_envelope_information( constructions_model )
  #Save to model.
  new_construction_set.setName(construction_id)
  constructions_model.building.get.setDefaultConstructionSet( new_construction_set.clone( constructions_model ).to_DefaultConstructionSet.get )

  #Give adiabatic surfaces a construction. Does not matter what. This is a bug in Openstudio that leave these surfaces unassigned by the default construction set.
  all_adiabatic_surfaces = BTAP::Geometry::Surfaces::filter_by_boundary_condition(constructions_model.getSurfaces, "Adiabatic")
  BTAP::Geometry::Surfaces::set_surfaces_construction( all_adiabatic_surfaces, constructions_model.building.get.defaultConstructionSet.get.defaultInteriorSurfaceConstructions.get.wallConstruction.get)

end

#fan_effObject

This method will get and set the coiling coil fan Speed COP



122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/openstudio-standards/btap/vintagizer.rb', line 122

def fan_eff()
  #DX Coil COP ECMs
  unless 'default' == cop_info[1]
    constructions_model.getCoilCoolingDXSingleSpeeds.sort.each do |cooling_coil|
      cooling_coil.setRatedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ))
    end
    constructions_model.getCoilCoolingDXTwoSpeeds.sort.each do |cooling_coil|
      cooling_coil.setRatedHighSpeedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ) )
      cooling_coil.setRatedLowSpeedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ))
    end
  end
end

#infiltrationObject

This method will set infiltration magnitude.



110
111
112
113
114
115
116
117
118
# File 'lib/openstudio-standards/btap/vintagizer.rb', line 110

def infiltration()

  BTAP::Resources::SpaceLoads::ScaleLoads::set_inflitration_magnitude( constructions_model,
    0.0, #setDesignFlowRate,
    0.0, #setFlowperSpaceFloorArea,
    0.0, #setFlowperExteriorSurfaceArea,
    0.0  #setAirChangesperHour
  )
end

#pump_effObject

This method will get and set the coiling coil pump Speed COP



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/openstudio-standards/btap/vintagizer.rb', line 137

def pump_eff()
  #DX Coil COP ECMs
  unless 'default' == cop_info[1]
    constructions_model.getCoilCoolingDXSingleSpeeds.sort.each do |cooling_coil|
      cooling_coil.setRatedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ))
    end
    constructions_model.getCoilCoolingDXTwoSpeeds.sort.each do |cooling_coil|
      cooling_coil.setRatedHighSpeedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ) )
      cooling_coil.setRatedLowSpeedCOP( OpenStudio::OptionalDouble.new( cop_info[1][0] ))
    end
  end
end