Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check hard-sized values before autosized values #1475

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ def pump_standard_minimum_motor_efficiency_and_size(pump, motor_bhp)
# Get flow rate (whether autosized or hard-sized)
flow_m3_per_s = 0
flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
if pump.autosizedRatedFlowRate.is_initialized
pump.autosizedRatedFlowRate.get
else
if pump.ratedFlowRate.is_initialized
pump.ratedFlowRate.get
elsif pump.autosizedRatedFlowRate.is_initialized
pump.autosizedRatedFlowRate.get
end
elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
if pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
else
if pump.totalRatedFlowRate.is_initialized
pump.totalRatedFlowRate.get / pump.numberofPumpsinBank
elsif pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
end
end
flow_gpm = OpenStudio.convert(flow_m3_per_s, 'm^3/s', 'gal/min').get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def pump_variable_speed_control_type(pump)
return false unless plant_loop_type == 'Heating' || plant_loop_type == 'Cooling'

# Get rated pump power
if pump.autosizedRatedPowerConsumption.is_initialized
pump_rated_power_w = pump.autosizedRatedPowerConsumption.get
elsif pump.ratedPowerConsumption.is_initialized
if pump.ratedPowerConsumption.is_initialized
pump_rated_power_w = pump.ratedPowerConsumption.get
elsif pump.autosizedRatedPowerConsumption.is_initialized
pump_rated_power_w = pump.autosizedRatedPowerConsumption.get
else
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Pump', "For #{pump.name}, could not find rated pump power consumption, cannot determine w per gpm correctly.")
return false
Expand Down
46 changes: 23 additions & 23 deletions lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,14 @@ def air_loop_hvac_optimum_start_required?(air_loop_hvac)
# Get design supply air flow rate (whether autosized or hard-sized)
dsn_air_flow_m3_per_s = 0
dsn_air_flow_cfm = 0
if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
else
if air_loop_hvac.designSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
end
# Optimum start per 6.4.3.3.3, only required if > 10,000 cfm
cfm_limit = 10_000
Expand Down Expand Up @@ -434,14 +434,14 @@ def air_loop_hvac_fan_power_limitation_pressure_drop_adjustment_brake_horsepower
# Get design supply air flow rate (whether autosized or hard-sized)
dsn_air_flow_m3_per_s = 0
dsn_air_flow_cfm = 0
if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
else
if air_loop_hvac.designSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
end

# @todo determine the presence of MERV filters and other stuff
Expand Down Expand Up @@ -492,14 +492,14 @@ def air_loop_hvac_allowable_system_brake_horsepower(air_loop_hvac)
# Get design supply air flow rate (whether autosized or hard-sized)
dsn_air_flow_m3_per_s = 0
dsn_air_flow_cfm = 0
if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
else
if air_loop_hvac.designSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
end

# Get the fan limitation pressure drop adjustment bhp
Expand Down Expand Up @@ -720,14 +720,14 @@ def air_loop_hvac_apply_baseline_fan_pressure_rise(air_loop_hvac)

# Get design supply air flow rate (whether autosized or hard-sized)
dsn_air_flow_m3_per_s = 0
if fan.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = fan.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
else
if fan.designSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = fan.designSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = User entered Design Supply Air Flow Rate.")
elsif fan.autosizedDesignSupplyAirFlowRate.is_initialized
dsn_air_flow_m3_per_s = fan.autosizedDesignSupplyAirFlowRate.get
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
end

# Determine the fan pressure rise that will result in the target bhp
Expand Down Expand Up @@ -2006,10 +2006,10 @@ def air_loop_hvac_adjust_minimum_vav_damper_positions(air_loop_hvac)
# System primary airflow rate (whether autosized or hard-sized)
v_ps = 0.0

v_ps = if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
else
v_ps = if air_loop_hvac.designSupplyAirFlowRate.is_initialized
air_loop_hvac.designSupplyAirFlowRate.get
elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
end
v_ps_cfm = OpenStudio.convert(v_ps, 'm^3/s', 'cfm').get

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def air_terminal_single_duct_parallel_piu_reheat_apply_prm_baseline_fan_power(ai

# Get the maximum flow rate through the terminal
max_primary_air_flow_rate = nil
if air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.is_initialized
max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.get
elsif air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.is_initialized
if air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.is_initialized
max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.get
elsif air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.is_initialized
max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.get
end

# Set the max secondary air flow rate
Expand Down
12 changes: 6 additions & 6 deletions lib/openstudio-standards/standards/Standards.Fan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def fan_apply_standard_minimum_motor_efficiency(fan, allowed_bhp)
def fan_adjust_pressure_rise_to_meet_fan_power(fan, target_fan_power)
# Get design supply air flow rate (whether autosized or hard-sized)
dsn_air_flow_m3_per_s = 0
dsn_air_flow_m3_per_s = if fan.autosizedMaximumFlowRate.is_initialized
fan.autosizedMaximumFlowRate.get
else
dsn_air_flow_m3_per_s = if fan.maximumFlowRate.is_initialized
fan.maximumFlowRate.get
elsif fan.autosizedMaximumFlowRate.is_initialized
fan.autosizedMaximumFlowRate.get
end

# Get the current fan power
Expand Down Expand Up @@ -356,10 +356,10 @@ def fan_rated_w_per_cfm(fan)
OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Fan', "For #{fan.name}, could not find rated fan power from Equipment Summary. Will calculate it based on current pressure rise and total fan efficiency")
end

if fan.autosizedMaximumFlowRate.is_initialized
max_m3_per_s = fan.autosizedMaximumFlowRate.get
elsif fan.maximumFlowRate.is_initialized
if fan.maximumFlowRate.is_initialized
max_m3_per_s = fan.ratedFlowRate.get
elsif fan.autosizedMaximumFlowRate.is_initialized
max_m3_per_s = fan.autosizedMaximumFlowRate.get
else
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Fan', "For #{fan.name}, could not find fan Maximum Flow Rate, cannot determine w per cfm correctly.")
return false
Expand Down
40 changes: 21 additions & 19 deletions lib/openstudio-standards/standards/Standards.Pump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ def pump_apply_prm_pressure_rise_and_motor_efficiency(pump, target_w_per_gpm)
# Get flow rate (whether autosized or hard-sized)
flow_m3_per_s = 0
flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
if pump.autosizedRatedFlowRate.is_initialized
pump.autosizedRatedFlowRate.get
else
if pump.ratedFlowRate.is_initialized
pump.ratedFlowRate.get
elsif pump.autosizedRatedFlowRate.is_initialized
pump.autosizedRatedFlowRate.get
end
elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
if pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
else
if pump.totalRatedFlowRate.is_initialized
pump.totalRatedFlowRate.get / pump.numberofPumpsinBank
elsif pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
end
end

Expand Down Expand Up @@ -178,16 +178,18 @@ def pump_pumppower(pump)
# Get flow rate (whether autosized or hard-sized)
flow_m3_per_s = 0
flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
if pump.autosizedRatedFlowRate.is_initialized
if pump.ratedFlowRate.is_initialized
pump.ratedFlowRate.get
elsif pump.autosizedRatedFlowRate.is_initialized
pump.autosizedRatedFlowRate.get
else
pump.ratedFlowRate.get
end
elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
if pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get
else
if pump.totalRatedFlowRate.is_initialized
pump.totalRatedFlowRate.get
elsif pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get
end
end

Expand Down Expand Up @@ -223,16 +225,16 @@ def pump_brake_horsepower(pump)
# Get flow rate (whether autosized or hard-sized)
flow_m3_per_s = 0
flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
if pump.autosizedRatedFlowRate.is_initialized
pump.autosizedRatedFlowRate.get
else
if pump.ratedFlowRate.is_initialized
pump.ratedFlowRate.get
elsif pump.autosizedRatedFlowRate.is_initialized
pump.autosizedRatedFlowRate.get
end
elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
if pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get
else
if pump.totalRatedFlowRate.is_initialized
pump.totalRatedFlowRate.get
elsif pump.autosizedTotalRatedFlowRate.is_initialized
pump.autosizedTotalRatedFlowRate.get
end
end

Expand Down Expand Up @@ -275,10 +277,10 @@ def pump_motor_horsepower(pump)
def pump_rated_w_per_gpm(pump)
# Get design power (whether autosized or hard-sized)
rated_power_w = 0
if pump.autosizedRatedPowerConsumption.is_initialized
rated_power_w = pump.autosizedRatedPowerConsumption.get
elsif pump.ratedPowerConsumption.is_initialized
if pump.ratedPowerConsumption.is_initialized
rated_power_w = pump.ratedPowerConsumption.get
elsif pump.autosizedRatedPowerConsumption.is_initialized
rated_power_w = pump.autosizedRatedPowerConsumption.get
else
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Pump', "For #{pump.name}, could not find rated pump power consumption, cannot determine w per gpm correctly.")
return 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def zone_hvac_component_apply_prm_baseline_fan_power(zone_hvac_component)

# Get the maximum flow rate through the fan
max_air_flow_rate = nil
if fan.autosizedMaximumFlowRate.is_initialized
max_air_flow_rate = fan.autosizedMaximumFlowRate.get
elsif fan.maximumFlowRate.is_initialized
if fan.maximumFlowRate.is_initialized
max_air_flow_rate = fan.maximumFlowRate.get
elsif fan.autosizedMaximumFlowRate.is_initialized
max_air_flow_rate = fan.autosizedMaximumFlowRate.get
end
max_air_flow_rate_cfm = OpenStudio.convert(max_air_flow_rate, 'm^3/s', 'ft^3/min').get

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ def air_loop_hvac_apply_prm_baseline_fan_power(air_loop_hvac)
if supply_fan.nil?
OpenStudio.logFree(OpenStudio::Error, 'openstudio.ashrae_90_1_prm.AirLoopHVAC', "Supply not found on #{airloop.name}.")
end
supply_fan_max_flow = if supply_fan.autosizedMaximumFlowRate.is_initialized
supply_fan.autosizedMaximumFlowRate.get
else
supply_fan_max_flow = if supply_fan.maximumFlowRate.is_initialized
supply_fan.maximumFlowRate.get
elsif supply_fan.autosizedMaximumFlowRate.is_initialized
supply_fan.autosizedMaximumFlowRate.get
end

# Check that baseline system has the same
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3032,10 +3032,10 @@ def model_refine_size_dependent_values(model, sizing_run_dir)

# Get the maximum flow rate through the terminal
max_primary_air_flow_rate = nil
if pfp_term.autosizedMaximumPrimaryAirFlowRate.is_initialized
max_primary_air_flow_rate = pfp_term.autosizedMaximumPrimaryAirFlowRate.get
elsif pfp_term.maximumPrimaryAirFlowRate.is_initialized
if pfp_term.maximumPrimaryAirFlowRate.is_initialized
max_primary_air_flow_rate = pfp_term.maximumPrimaryAirFlowRate.get
elsif pfp_term.autosizedMaximumPrimaryAirFlowRate.is_initialized
max_primary_air_flow_rate = pfp_term.autosizedMaximumPrimaryAirFlowRate.get
end

max_sec_flow_rate_m3_per_s = max_primary_air_flow_rate * sec_flow_frac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def zone_hvac_component_apply_prm_baseline_fan_power(zone_hvac_component)
# Get design supply air flow rate (whether autosized or hard-sized)
dsn_air_flow_m3_per_s = 0
dsn_air_flow_cfm = 0
if fan.isMaximumFlowRateAutosized
dsn_air_flow_m3_per_s = fan.autosizedMaximumFlowRate.get
else
if fan.maximumFlowRate.is_initialized
dsn_air_flow_m3_per_s = fan.maximumFlowRate.get
elsif fan.isMaximumFlowRateAutosized
dsn_air_flow_m3_per_s = fan.autosizedMaximumFlowRate.get
end
dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get

Expand Down Expand Up @@ -91,10 +91,10 @@ def zone_hvac_component_apply_prm_baseline_fan_power(zone_hvac_component)

# Get the maximum flow rate through the fan
max_air_flow_rate = nil
if fan.autosizedMaximumFlowRate.is_initialized
max_air_flow_rate = fan.autosizedMaximumFlowRate.get
elsif fan.maximumFlowRate.is_initialized
if fan.maximumFlowRate.is_initialized
max_air_flow_rate = fan.maximumFlowRate.get
elsif fan.autosizedMaximumFlowRate.is_initialized
max_air_flow_rate = fan.autosizedMaximumFlowRate.get
end
max_air_flow_rate_cfm = OpenStudio.convert(max_air_flow_rate, 'm^3/s', 'ft^3/min').get

Expand Down
Loading