Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)
, wherem = -p0/((dp_sat/dT_sat)*T0*T0)
,dp_sat/dT_sat = (sl - sv)/(vl - vv)
To accompany the changes in saturation temperature,
bubble_temperature
anddew_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.