You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculating specific heat capacities (cp or cv) for states near the saturation curve give incorrect results. The values appear to asymptotically approach the values which are returned inside the liquid/vapor region (where the reported values of cp are incorrect -- cp should be infinite there). For example:
This behavior is consistent across all of the "TPX" species, so this is an issue with its algorithm for evaluating heat capacities, rather than an issue with any of the particular equations of state.
The text was updated successfully, but these errors were encountered:
This is because the specific heats are evaluated numerically as T*(s(T+dt) - s(T-dt))/((T+dt) - (T-dt)) at either constant volume or constant pressure. If T is close enough to T_sat, adding or subtracting dT will push one point or the other into the vapor dome, resulting in the incorrect values shown here. It seems a new algorithm for calculating the derivative is necessary.
Calculating cv and cp by finite difference seems a bit silly when s is computed by integrating the expression for cv(T) in the first place. But implementing that would require a separate method for each species, rather than a single implementation in Substance, which is probably why it was initially done this way.
Only part of s for the TPX substances is calculated by integrating cv(T). In particular, the only portion of cv(T) given by the curve fits in Reynolds' book is the zero-density limit, so calculating cv(T,p) for substances not near that limit is not possible with only the given coefficients (the G array). I don't think writing an implementation in each Substance is a particular disadvantage, provided that each substance had an accurate, explicit formula - the trouble is, they don't (as far as I know). I suppose it would hypothetically be possible to analytically differentiate the formula for s for each Substance, but that sounds like a big pain, given the complexity of the EOS.
It seems like it should be fairly easy to improve this situation by either ensuring that the step size in T for the current formulation doesn't go into the two-phase region, using a higher-order differentiation, possibly with varying step sizes, or both. This would likely come at the cost of increased computational time though.
Calculating specific heat capacities (cp or cv) for states near the saturation curve give incorrect results. The values appear to asymptotically approach the values which are returned inside the liquid/vapor region (where the reported values of cp are incorrect -- cp should be infinite there). For example:
which gives:
In comparison to the results which can be obtained from the NIST Chemistry Webbook.
This behavior is consistent across all of the "TPX" species, so this is an issue with its algorithm for evaluating heat capacities, rather than an issue with any of the particular equations of state.
The text was updated successfully, but these errors were encountered: