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

fix: make iteration loops for simplified train consistent #263

Merged
merged 1 commit into from
Oct 31, 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 @@ -560,11 +560,6 @@ def calculate_maximum_rate_given_outlet_pressure_single_calculation_point(
" This should normally not happen. Please contact eCalc support."
)

maximum_actual_volume_rate = maximum_rate_function(
heads=polytropic_head,
extrapolate_heads_below_minimum=False,
)

return maximum_actual_volume_rate


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def test_calculate_maximum_rate_given_outlet_pressure_all_calculation_points(
pressure_ratios = [1, 2, 3, 4, 5, 10, 100, 1000]

# These expected max rates are here just to assure stability in the results. They are not assured to be correct!
approx_expected_max_rates = [1116990, 1359255, 1536130, 1052085, 1052085, 1052085, 1052085, 1052085]
approx_expected_max_rates = [1116990, 1359022, 1536130, 1052085, 1052085, 1052085, 1052085, 1052085]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The iteration loop stops when the change in actual rate less than 0.1% from one iteration to the next. This PR basically removes the next update here. In the time step that changed here, the change was 0.09% when the iteration stops - the change in the next step (which is now removed for consistency) is 0.017%. For all other time steps the change in actual rate when the iterations stops are much less than 0.1%, and no visible difference in the test.

for pressure_ratio, approx_expected_max_rate in zip(pressure_ratios, approx_expected_max_rates):
calculated_max_rate = (
CompressorTrainSimplifiedKnownStages.calculate_maximum_rate_given_outlet_pressure_all_calculation_points(
Expand Down