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

Hook-up generator and new unitary DX equipment module #108

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

lymereJ
Copy link
Collaborator

@lymereJ lymereJ commented Aug 28, 2024

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.

Comment on lines -43 to +44
"aed": [80,67],
"aew": [67,57],
"aed": 80,
"aew": 67,
Copy link
Collaborator Author

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.

Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean from AHRI 340/360? 67/57 is used for low temperature operating cooling, not for standard operation.

image

@@ -37,20 +37,20 @@
}
}
},
"UnitaryDirectExpansion": {
"unitarydirectexpansion": {
Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Comment on lines +225 to +229
else:
logging.critical(
f"Target not met after {self.max_gen} generations; No solution was found."
)
return
Copy link
Collaborator Author

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.

Comment on lines +269 to +288
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preliminary target check.

Comment on lines -126 to +132
"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},
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing field.

Comment on lines +295 to +300
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
Copy link
Collaborator Author

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.

Comment on lines +34 to +60
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

Copy link
Collaborator Author

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.

@lymereJ lymereJ requested a review from wanhanlong1130 August 28, 2024 05:42
@wanhanlong1130 wanhanlong1130 merged commit e668cb9 into develop Sep 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants