lib/openstudio-standards/btap/measures.rb in openstudio-standards-0.1.11 vs lib/openstudio-standards/btap/measures.rb in openstudio-standards-0.1.12
- old
+ new
@@ -797,30 +797,30 @@
unless model.getFanVariableVolumes.empty?
log = "fan_variable_volume_name,fan_total_eff,fan_motor_eff\n"
model.getFanVariableVolumes.each do |fan|
fan.setFanEfficiency( @fan_total_eff ) unless @fan_total_eff.nil?
fan.setMotorEfficiency( @fan_motor_eff ) unless @fan_motor_eff.nil?
- log << fan.getAttribute("name").get.valueAsString << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
+ log << fan.name.get.to_s << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
end
end
unless model.getFanConstantVolumes.empty?
log = "fan_constant_volume_name,fan_total_eff,fan_motor_eff\n"
model.getFanConstantVolumes.each do |fan|
fan.setFanEfficiency( @fan_total_eff ) unless @fan_total_eff.nil?
fan.setMotorEfficiency( @fan_motor_eff ) unless @fan_motor_eff.nil?
- log << fan.getAttribute("name").get.valueAsString << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
+ log << fan.name.get.to_s << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
end
end
case @fan_volume_type
when "VariableVolume"
model.getFanConstantVolumes.each do |fan_const|
#check that this is indeed connected to an airloop.
- log << "Found Const Vol Fan #{fan_const.getAttribute("name").get.valueAsString}"
+ log << "Found Const Vol Fan #{fan_const.name.get.to_s}"
unless fan_const.loop.empty?
fan_variable = OpenStudio::Model::FanVariableVolume.new(model,fan_const.availabilitySchedule)
#pass information from old fan as much as possible.
fan_variable.setFanEfficiency(fan_const.fanEfficiency)
fan_variable.setPressureRise( fan_const.pressureRise() )
@@ -837,17 +837,17 @@
air_loop = fan_const.loop.get
#add the FanVariableVolume
fan_variable.addToNode(air_loop.supplyOutletNode())
#Remove FanConstantVolume
fan_const.remove()
- log << "Replaced by Variable Vol Fan #{fan_variable.getAttribute("name").get.valueAsString}"
+ log << "Replaced by Variable Vol Fan #{fan_variable.name.get.to_s}"
end
end
when "ConstantVolume"
model.getFanVariableVolumes.each do |fan|
#check that this is indeed connected to an airloop.
- log << "Found Const Vol Fan #{fan.getAttribute("name").get.valueAsString}"
+ log << "Found Const Vol Fan #{fan.name.get.to_s}"
unless fan.loop.empty?
new_fan = OpenStudio::Model::FanConstantVolume.new(model,fan.availabilitySchedule)
#pass information from constant speed fan as much as possible.
new_fan.setFanEfficiency(fan.fanEfficiency)
new_fan.setPressureRise( fan.pressureRise() )
@@ -858,11 +858,11 @@
air_loop = fan.loop.get
#add the FanVariableVolume
new_fan.addToNode(air_loop.supplyOutletNode())
#Remove FanConstantVolume
fan.remove()
- log << "Replaced by Constant Vol Fan #{new_fan.getAttribute("name").get.valueAsString}"
+ log << "Replaced by Constant Vol Fan #{new_fan.name.get.to_s}"
end
end
when nil
log << "No changes to Fan."
else
@@ -883,27 +883,27 @@
unless model.getPumpVariableSpeeds.empty?
log = "pump_variable_speed_name,@pump_motor_eff\n"
model.getPumpVariableSpeeds.each do |pump|
pump.setMotorEfficiency( @pump_motor_eff.to_f ) unless @pump_motor_eff.nil?
pump.setPumpControlType( @pump_control_type ) unless @pump_control_type.nil?
- log << pump.getAttribute("name").get.valueAsString << ",#{pump.motorEfficiency}\n"
+ log << pump.name.get.to_s << ",#{pump.motorEfficiency}\n"
end
end
unless model.getPumpConstantSpeeds.empty?
log << "pump_variable_speed_name,@pump_motor_eff\n"
model.getPumpConstantSpeeds.each do |pump|
pump.setMotorEfficiency( @pump_motor_eff.to_f ) unless @pump_motor_eff.nil?
pump.setPumpControlType( @pump_control_type ) unless @pump_control_type.nil?
- log << pump.getAttribute("name").get.valueAsString << ",#{pump.motorEfficiency}\n"
+ log << pump.name.get.to_s << ",#{pump.motorEfficiency}\n"
end
end
#set pump speed type based on existing pump.
case @pump_speed_type
when "VariableSpeed"
model.getPumpConstantSpeeds.each do |pump_const|
- log << "Found Const Vol Fan #{pump_const.getAttribute("name").get.valueAsString}"
+ log << "Found Const Vol Fan #{pump_const.name.get.to_s}"
#check that this is indeed connected to an plant loop.
unless pump_const.plantLoop.empty?
pump_variable = OpenStudio::Model::PumpVariableSpeed.new(model)
#pass information from constant speed fan as much as possible.
pump_variable.setRatedFlowRate(pump_const.getRatedFlowRate.get)
@@ -919,16 +919,16 @@
hw_loop = pump_const.plantLoop.get
#Remove PumpConstantSpeed
pump_const.remove()
#add
pump_variable.addToNode(hw_loop.supplyInletNode)
- log << "Replaced by Variable Vol Pump #{pump_variable.getAttribute("name").get.valueAsString}"
+ log << "Replaced by Variable Vol Pump #{pump_variable.name.get.to_s}"
end
end #end loop PumpConstantSpeeds
when "ConstantSpeed"
model.getPumpVariableSpeeds.each do |pump|
- log << "Found Variable Speed Pump #{pump.getAttribute("name").get.valueAsString}"
+ log << "Found Variable Speed Pump #{pump.name.get.to_s}"
#check that this is indeed connected to an plant loop.
unless pump.plantLoop.empty?
new_pump = OpenStudio::Model::PumpVariableSpeed.new(model)
#pass information from constant speed fan as much as possible.
@@ -945,11 +945,11 @@
#Remove PumpVariableSpeed
pump.remove()
#add the pump to loop.
new_pump.addToNode(hw_loop.supplyInletNode)
- log << "Replaced by constant speed Pump #{new_pump.getAttribute("name").get.valueAsString}"
+ log << "Replaced by constant speed Pump #{new_pump.name.get.to_s}"
end
end #end loop Pump variable Speeds
when nil
log << "No changes"
else
@@ -973,11 +973,11 @@
log = "coil_cooling_dx_single_speed_name,cop\n"
model.getCoilCoolingDXSingleSpeeds.each do |cooling_coil|
cooling_coil.setRatedCOP( OpenStudio::OptionalDouble.new( @cop ) ) unless @cop.nil?
cop = "NA"
cop = cooling_coil.ratedCOP.get unless cooling_coil.ratedCOP.empty?
- log << cooling_coil.getAttribute("name").get.valueAsString << ",#{cop}\n"
+ log << cooling_coil.name.get.to_s << ",#{cop}\n"
end
end
unless model.getCoilCoolingDXTwoSpeeds.empty?
@@ -987,11 +987,11 @@
cooling_coil.setRatedLowSpeedCOP( @cop ) unless @cop.nil?
cop_high = "NA"
cop_high = cooling_coil.ratedHighSpeedCOP.get unless cooling_coil.ratedHighSpeedCOP.empty?
cop_low = "NA"
cop_low = cooling_coil.ratedLowSpeedCOP.get unless cooling_coil.ratedLowSpeedCOP.empty?
- log << cooling_coil.getAttribute("name").get.valueAsString << ",#{cop_high},#{cop_low}\n"
+ log << cooling_coil.name.get.to_s << ",#{cop_high},#{cop_low}\n"
end
end
return log
end
def ecm_economizers( model )
@@ -1069,11 +1069,11 @@
unless @shw_setpoint_sched_name.nil? or @shw_setpoint_sched.nil?
item.setSetpointTemperatureSchedule(schedule)
end
item.setHeaterFuelType(@shw_heater_fuel_type) unless @shw_heater_fuel_type.nil?
item.setHeaterThermalEfficiency(@shw_thermal_eff) unless @shw_thermal_eff.nil?
- log << item.getAttribute("name").get.valueAsString << ",#{item.setpointTemperatureSchedule},#{item.heaterFuelType},#{item.getHeaterThermalEfficiency.get}\n"
+ log << item.name.get.to_s << ",#{item.setpointTemperatureSchedule},#{item.heaterFuelType},#{item.getHeaterThermalEfficiency.get}\n"
end
return log
end
def ecm_hotwater_boilers( model )
measure_values = [
@@ -1172,10 +1172,10 @@
oar_stpt_manager.setSetpointatOutdoorHighTemperature(@hw_boiler_reset_lowsupplytemp) unless @hw_boiler_reset_lowsupplytemp.nil?
oar_stpt_manager.setOutdoorHighTemperature(@hotwaterboiler_reset_outsidelowsupplytemp) unless @hw_boiler_reset_outsidelowsupplytemp.nil?
oar_stpt_manager.setSetpointatOutdoorLowTemperature(@hw_boiler_reset_highsupplytemp) unless @hw_boiler_reset_highsupplytemp.nil?
oar_stpt_manager.setOutdoorLowTemperature(@hw_boiler_reset_outsidehighsupplytemp) unless @hw_boiler_reset_outsidehighsupplytemp.nil?
end
- table << boiler.getAttribute("name").get.valueAsString << ","
+ table << boiler.name.get.to_s << ","
boiler.designWaterOutletTemperature.empty? ? dowt = "NA" : dowt = boiler.designWaterOutletTemperature.get
table << "#{dowt},#{boiler.fuelType},#{boiler.nominalThermalEfficiency}\n"
end
end
end #end boilers loop