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

faster saturation_temperature. #249

Merged
merged 12 commits into from
Jan 10, 2024
Merged

faster saturation_temperature. #249

merged 12 commits into from
Jan 10, 2024

Conversation

longemen3000
Copy link
Member

This PR is similar to the one on saturation_pressure. with a non allocating saturation pressure, we can use one step of that to greatly improve the initial point at a relatively low cost. the refinement step was changed from linear (T = T0 + k*(p - p0) to log-inv (1/T = 1/T0 + m*(log(p/p0), where m = -p0/((dp_sat/dT_sat)*T0*T0), dp_sat/dT_sat = (sl - sv)/(vl - vv)

To accompany the changes in saturation temperature, bubble_temperature and dew_temperature were modified to skip the critical point calculation if not necessary, For values over the critical point, we now use critical point extrapolation, extending the saturation slope until p or T matches (m = -pc/((dp/dT)*Tc*Tc) evaluated at the critical point). we solve the extended antoine relation until finding a suitable T0. because we are now using local info instead of an universal antoine coefficient, the initial values of temperature are closer than the ones recommended by the old alg.

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: 43 lines in your changes are missing coverage. Please review.

Comparison is base (9161750) 79.70% compared to head (af87c95) 79.87%.

Files Patch % Lines
src/methods/initial_guess.jl 83.33% 14 Missing ⚠️
...y_solvers/singlecomponent/saturation/AntoineSat.jl 67.74% 10 Missing ⚠️
...ds/property_solvers/multicomponent/bubble_point.jl 87.69% 8 Missing ⚠️
src/models/cubic/equations.jl 0.00% 3 Missing ⚠️
...solvers/singlecomponent/saturation/ClapeyronSat.jl 80.00% 2 Missing ⚠️
..._solvers/singlecomponent/saturation/IsoFugacity.jl 60.00% 2 Missing ⚠️
...thods/property_solvers/multicomponent/dew_point.jl 95.45% 1 Missing ⚠️
src/models/cubic/PR/PR.jl 66.66% 1 Missing ⚠️
src/models/cubic/RK/RK.jl 50.00% 1 Missing ⚠️
src/models/cubic/vdW/vdW.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
+ Coverage   79.70%   79.87%   +0.16%     
==========================================
  Files         279      279              
  Lines       19532    19508      -24     
==========================================
+ Hits        15568    15582      +14     
+ Misses       3964     3926      -38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@longemen3000 longemen3000 merged commit d104245 into master Jan 10, 2024
22 checks passed
@longemen3000 longemen3000 deleted the sat_T_accuracy branch January 13, 2024 04:25
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.

1 participant