From aee3878c69e80966b8c8474898492dbe118128e5 Mon Sep 17 00:00:00 2001 From: KarenWGard <114143532+KarenWGard@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:08:20 -0400 Subject: [PATCH] Update Rule22-42.md --- docs/section22/Rule22-42.md | 49 +++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/docs/section22/Rule22-42.md b/docs/section22/Rule22-42.md index bd6c485df..9eab7eadb 100644 --- a/docs/section22/Rule22-42.md +++ b/docs/section22/Rule22-42.md @@ -21,9 +21,9 @@ J-6 - get the chiller rated capacity: `rated_capacity = chiller.rated_capacity` - convert the chiller rated capacity from watts to tons: `chiller_capacity_tons = rated_capacity * 0.000284345` - check if the compressor type is CENTRIFUGAL: `if chiller.compressor_type == "CENTRIFUGAL":` - - if the capacity is less than 150 tons, the category is V: `if chiller_capacity_tons < 150: curve_set = "V"` - - else if the capacity is greater than or equal to 300 tons, the category is Y: `elif chiller_capacity_tons >= 300: curve_set = "Y"` - - otherwise, the capacity is between 150 and 300, so the curves set is X: `else: curve_set = "X"` + - if the capacity is less than 150 tons, the category is Z: `if chiller_capacity_tons < 150: curve_set = "Z"` + - else if the capacity is greater than or equal to 300 tons, the category is AB: `elif chiller_capacity_tons >= 300: curve_set = "AB"` + - otherwise, the capacity is between 150 and 300, so the curves set is AA: `else: curve_set = "AA"` - otherwise, check if the compressor type is POSITIVE_DISPLACEMENT or SCROLL: `if chiller.compressor_type in ["POSITIVE_DISPLACEMENT","SCROLL"]:` - if the capacity is less than 150 tons, the category is Z: `if chiller_capacity_tons < 150: curve_set = "Z"` - else if the capacity is greater than or equal to 300 tons, the category is AA: `elif chiller_capacity_tons >= 300: curve_set = "AA"` @@ -31,44 +31,45 @@ J-6 - continue if the curve set is not "NONE" - the curve set could be none if the chiller.compressor_type is not one of the recognized types for Appendix G: `if curve_set <> "NONE":` - calculate the chiller rated power by dividing the chiller rated capacity by the chiller full load efficiency (cop): `rated_power = chiller.rated_capacity / chiller.full_load_efficiency` - create a list of the expected capacity validation points - this is in 25% intervals, starting with 0.25 to 1: `expected_validation_plr = [0.25,0.5,0.75,1]` - - create a list of the expected temperatures for the chilled water temperature for the validation calculations - expected_chwt_temps - units are (F). The values are selected to capture the minimum, maximum, rating condition and some points in between: `expected_cwt_temps = [39,45,50,55]` - - create a list of the expected entering condenser temperatures for the condenser water temperature for the validation calculations - expected_ect_temps - units are (F). The values are selected to capture the minimum, maximum, rating condition and some points in between: `expected_ect_temps = [60,104,85,72.5,97.5]` + - create a list of the expected temperatures for the chilled water temperature for the validation calculations - expected_chwt_temps - units are (F). The values are selected to capture the minimum, maximum, rating condition and some points in between: `expected_chwt_temps = [39,45,50,55]` + - create a list of the expected entering condenser temperatures for the condenser water temperature for the validation calculations - expected_ecwt_temps - units are (F). The values are selected to capture the minimum, maximum, rating condition and some points in between: `expected_ecwt_temps = [60,104,85,72.5,97.5]` - get the coefficients for the EIR-f-T curve (IP units) using a table lookup for table J-6. This assumes that the lookup function will return a list with the coefficients in order (C1,C2,...): `eir_f_t_coefficients = table_J_2_lookup(curve_set,"EIR-f-T")` - get the coefficients for the CAP-f-T curve (IP units) using a table lookup for table J-6. This assumes that the lookup function will return a list with the coefficients in order (C1,C2,...): `cap_f_t_coefficients = table_J_2_lookup(curve_set,"Cap-f-T")` - get the coefficients for the PLR curve (IP units) using a table lookup for table J-6. This assumes that the lookup function will return a list with the coefficients in order (C1,C2,...): `plr_coefficients = table_J_2_lookup(curve_set,"EIR-f-PLR")` - - create a variable (capacity_validation_status) to track whether the capacity validation passes and set it to "PASS" - if the capacity validation fails at any point, this variable will change to give the values at which the capacity validation failed: `capacity_validation_status = "PASS"` - - create a variable (power_validation_status) to track whether the power validation passes and set it to "PASS" - if the power validation fails at any point, this variable will change to give the values at which teh power validation failed: `power_validation_status = "PASS" - - convert the chiller.capacity_validation_points to a dictionary with the keys being a list of two values - [chilled_water_supply_temperature, condenser_temperature], and values being the capacity_validation_point itself. Sorting the validation points will allow the calculations that follow to be much simpler. Start by creating a dict capacity_validation_pts_dict: `capacity_validation_pts_dict = {}` - look at each value in chiller.capacity_validation_points: `for capacity_validation_point in chiller.capacity_validation_points:` - - add the point to capacity_validation_pts_dict: `capacity_validation_pts_dict[[capacity_validation_point.chilled_water_supply_temperature, capacity_validation_point.condenser_temperature]] = capacity_validation_point` + - add the point to capacity_validation_pts_dict: `capacity_validation_pts_dict[[capacity_validation_point.chilled_water_supply_temperature, capacity_validation_point.condenser_temperature]] = capacity_validation_point.result` - do the same conversion with the chiller.power_validation_points and storing the results in power_validation_pts_dict. However in this case, the values are a list of points because we expect different loads at each point: `power_validation_pts_dict = {}` - look at each value in chiller.power_validation_points: `for power_validation_point in chiller.power_validation_points:` - set the default to a blank list: `power_validation_pts_dict.setdefault([[power_validation_point.chilled_water_supply_temperature, power_validation_point.condenser_temperature]], [])` - - append the power validation point to the list at this given: `power_validation_pts_dict[[power_validation_point.chilled_water_supply_temperature, power_validation_point.condenser_temperature]].append(power_validation_point)` + - append the power validation point to the list at this given: `power_validation_pts_dict[[power_validation_point.chilled_water_supply_temperature, power_validation_point.condenser_temperature]].append(power_validation_point.result)` - create a dictionary of the expected capacities for use in the power validation check: `given_capacities = {}` - the following lines or logic do the capacity validation check: - - loop through the expected_cwt_temps: `for cwt in expected_cwt_temps:` - - loop through each expected_ect_temps: `for ect in expected_ect_temps:` + - create a list of non-matching capacity validation points: `non_matching_capacity_validation_points = []` + - create a list of missing capacity validation points: `missing_capacity_validation_points = []` + - loop through the expected_chwt_temps: `for cwt in expected_cwt_temps:` + - loop through each expected_ecwt_temps: `for ect in expected_ecwt_temps:` - look for the capacity validation point in capacity_validation_pts_dict: `if capacity_validation_pts_dict[[cwt, ect]]:` - calculate the expected capacity by multiplying the result of the formula by the rated_capacity: `expected_capacity = (cap_f_t_coefficients[0] + cap_f_t_coefficients[1] * cwt + cap_f_t_coefficients[2] * cwt^2 + cap_f_t_coefficients[3] * ect + cap_f_t_coefficients[4] * ect^2 + cap_f_t_coefficients[5] * cwt * ect) * rated_capacity` - - get the given capacity: `given_capacity = capacity_validation_pts_dict[[cwt, ect]].result` - - if the expected capacity matches the given capacity, add the expected capacity to the expected_capacities dictionary. This should not be an exact match, but with a margin of error (see notes at the bottom for suggested margins of errors): `if expected_capacity == given_capacity: given_capacities[[cwt,ect]] = given_capacity` - - otherwise, if the expected capacity doesn't match the given capacity, then change capacity_validation_status and go to Rule Assertion: `else: capacity_validation_status = "Expected capacity does not match given capacity at CHWT: " + cwt + " & ECT: " + ect; GO TO RULE ASSERTION` - - otherwise this value doesn't exist, set the capacity_validation_status and go to rule assertion: `else: capacity_validation_status = "Required capacity validation point is missing. Expected CHWT: " + cwt + ", expected ECT: " + ect; GO TO RULE ASSERTION` + - get the given capacity: `given_capacity = capacity_validation_pts_dict[[cwt, ect]]` + - add the given capacity to the given_capacities dictionary: `given_capacities[[cwt,ect]] = given_capacity` + - Compare the expected capacity to the given capacity. This should not be an exact match, but with a margin of error (see notes at the bottom for suggested margins of errors). We don't need to do anything if the capacities match, but if they don't match we need to add the conditions to the non_matching_capacity_validation_points list: `if expected_capacity != given_capacity: non_matching_capacity_validation_points.append({"CHWT": cwt, "ECWT": ect})` + - otherwise this value doesn't exist, append these conditions to the missing_capacity_validation_points list: `else: missing_capacity_validation_points.append({"CHWT": cwt, "ECWT": ect})` - the following lines or logic do the power validation check: + - create a list of non-matching power validation points: `non_matching_power_validation_points = []` + - create a list of missing power validation points: `missing_power_validation_points = []` - loop through the expected_cwt_temps: `for cwt in expected_cwt_temps:` - - loop through each expected_ect_temps: `for ect in expected_ect_temps:` + - loop through each expected_ecwt_temps: `for ect in expected_ecwt_temps:` - look for the power validation points in power_validation_pts_dict: `if power_validation_pts_dict[[cwt, ect]]:` - we are expecting to see multiple validation points aligning with the expected_validation_plr. Create a list of part load ratios that are given. Later we'll compare this with the expected list to make sure that all points are given: `given_plrs = []` - - look at each power validation point in the list: `for power_validation_point in power_validation_pts_dict[[cwt, ect]]:` + - look at each power validation point in the list: `for power_validation_point_result in power_validation_pts_dict[[cwt, ect]]:` - get the load: `load = power_validation_point.load` - - get the given power: `given_power = power_validation_point.result` + - get the given power: `given_power = power_validation_point_result` - calculate the PLR by dividing the load by the given capacity at these operating conditions: `plr = load / given_capacities[[cwt, ect]]` - check whether the plr is one of the plrs that we need to check: `if plr in expected_validation_plr:` - add the plr to the list of plrs provided: `given_plrs.append(plr)` @@ -80,13 +81,13 @@ J-6 - Chiller operating power = given_capacity[[cwt, ect]] × EIR-f-T × EIR-f-PLR × Chiller Input Power at Rated Conditions/Chiller Capacity at Rated Conditions - `expected_power = given_capacity[[cwt, ect]] * eir_ft * eir_plr * rated_power/rated_capacity` - - check whether the expected power and the given power are equal. This should not be an exact match, but with a margin of error (see notes at the bottom for suggested margins of errors). If the expected power and given power do not match, update power_validation_status and GO TO RULE ASSERTION: `if expected_power != given_power: power_validation_status = "Expected power does not match given power at CHWT: " + cwt + ", ECT: " + ect + " & " + plr".; GO TO RULE ASSERTION` - - make sure that all of the expected plrs are covered by + - check whether the expected power and the given power are equal. This should not be an exact match, but with a margin of error (see notes at the bottom for suggested margins of errors). If the expected power and given power do not match, add the conditions to the non_matching_power_validation_points list: `if expected_power != given_power: non_matching_power_validation_points.append({"CHWT": cwt, "ECWT": ect, "PLR": plr})` + - otherwise, this particular plr is not given, append these conditions to the missing_power_validation_points list: `missing_power_validation_points.append({"CHWT": cwt, "ECWT": ect, "PLR": plr})` + - otherwise, this point isn't given, append these conditions to the missing_power_validation_points list: `missing_power_validation_points.append({"CHWT": cwt, "ECWT": ect, "PLR": "ALL"})` **Rule Assertion:** - - Case 1: both power_validation_status and capacity_validation_status are PASS: PASS: `if power_validation_status == capacity_validation_status == "PASS"; PASS` - - Case 2: capacity validation status is not PASS, return fail and raise warning with the capacity_validation_status as an additional message: `if capacity_validation_status != "PASS": FAIL; raise_warning: capacity_validation_status` - - Case 3: power validation status is not PASS, return fail and raise warning with the power_validation_status as an additional message: `if power_validation_status != "PASS": FAIL; raise_warning: power_validation_status` + - Case 1: all lists of missing or non-matching validation points have a length of zero: PASS: `if len(non_matching_capacity_validation_points) == len(missing_capacity_validation_points) == len(non_matching_power_validation_points) == len(missing_power_validation_points) == 0: PASS` + - Case 2: all other cases fail: `else: FAIL` **Notes:**