-
Notifications
You must be signed in to change notification settings - Fork 4
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
Hook-up generator and new unitary DX equipment module #108
Conversation
"aed": [80,67], | ||
"aew": [67,57], | ||
"aed": 80, | ||
"aew": 67, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction; These were supposed to be single values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but, these values are from the 210/240 I think, for two points; though they are not used in the code. We just ignore the 67,57 pair?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -37,20 +37,20 @@ | |||
} | |||
} | |||
}, | |||
"UnitaryDirectExpansion": { | |||
"unitarydirectexpansion": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the case for consitency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check for other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall that we had issues with that in other places. If it works, that's good, if not, that's okay.
else: | ||
logging.critical( | ||
f"Target not met after {self.max_gen} generations; No solution was found." | ||
) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error when the number of generations has been exceeded.
elif self.equipment.type == "UnitaryDirectExpansion": | ||
if self.equipment.set_of_curves != "": | ||
part_rating = self.equipment.calc_rated_eff( | ||
eff_type="ieer", unit=self.equipment.part_eff_unit | ||
) | ||
part_rating_alt = 0 | ||
full_rating_alt = 0 | ||
full_rating = self.full_eff | ||
cap_rating = 0 | ||
# full_rating = self.equipment.calc_rated_eff( | ||
# eff_type="full", unit=self.equipment.full_eff_unit | ||
# ) | ||
# cap_rating = 0 | ||
# if "cap-f-t" in self.vars: | ||
# for c in self.equipment.set_of_curves: | ||
# # set_of_curves | ||
# if "cap" in c.out_var: | ||
# cap_rating += abs(1 - c.get_out_reference(self.equipment)) | ||
else: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary target check.
"eir-f-f": {"x1_min": 0, "x1_max": 1, "x1_norm": 1, "nbval": nb_val}, | ||
"cap-f-f": {"x1_min": 0, "x1_max": 1, "x1_norm": 1, "nbval": nb_val}, | ||
"eir-f-ff": {"x1_min": 0, "x1_max": 1, "x1_norm": 1, "nbval": nb_val}, | ||
"cap-f-ff": {"x1_min": 0, "x1_max": 1, "x1_norm": 1, "nbval": nb_val}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo.
@@ -122,9 +126,10 @@ def __init__( | |||
"x2_min": 10, | |||
"x2_max": 40, | |||
"x2_norm": ect, | |||
"nbval": nb_val, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing field.
dx_data = equipment_references[self.type.lower()][std][self.condenser_type] | ||
# Air entering indoor dry-bulb | ||
aed = Equipment.convert_to_deg_c(dx_data["aed"], dx_data["ae_unit"]) | ||
# Air entering indoor wet-bulb | ||
aew = Equipment.convert_to_deg_c(dx_data["aew"], dx_data["ae_unit"]) | ||
# Outdoor water/air entering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change code to apply conversion to single value.
def test_generation(self): | ||
lib = cp.Library(path=DX_lib) | ||
dx_unit = cp.UnitaryDirectExpansion( | ||
compressor_type="scroll", | ||
condenser_type="air", | ||
compressor_speed="constant", | ||
ref_cap_unit="si", | ||
ref_gross_cap=471000, | ||
full_eff=5.89, | ||
full_eff_unit="cop", | ||
part_eff_ref_std="ahri_340/360", | ||
model="simplified_bf", | ||
sim_engine="energyplus", | ||
set_of_curves=lib.get_set_of_curves_by_name("D208122216").curves, | ||
fan_control_mode="constant_speed", | ||
) | ||
dx_unit.part_eff = 8.5 | ||
set_of_curves = dx_unit.generate_set_of_curves( | ||
base_curves=[lib.get_set_of_curves_by_name("D208122216")], | ||
tol=0.01, | ||
verbose=True, | ||
vars=["eir-f-t"], | ||
max_gen=300, | ||
max_restart=3, | ||
) | ||
assert len(set_of_curves) == 5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test that showcases the generation process.
This PR make necessary changes to get a bare-bone connection from the new unitary DX module and the generator. A new test was added to show that the generator is able to generate sets of curves that meet a targeted efficiency. Note that this is a set of functional preliminary changes, refinements will be required.