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

Convergence failure with high densities #46

Closed
chmarti1 opened this issue Aug 15, 2022 · 1 comment
Closed

Convergence failure with high densities #46

chmarti1 opened this issue Aug 15, 2022 · 1 comment

Comments

@chmarti1
Copy link
Owner

In version 2.2.1 and probably before, there are some multi-phase models (like N2 and CO2) that fail to converge at low temperatures and very high pressures. The minimum,maximum density limits contained in the multi-phase dlim data element are not used by the front end, but they are used to establish iteration boundaries in the back-end. A standard value of 1600kg/m3 was set when developing for steam, and it was kept by default when expanding to other substances. Through an oversight, it was never re-evaluated for other substances, so certain high-pressure, low-temperature conditions are not currently accessible even though they should be. It wasn't caught in development because most validating data sets provided by the original model authors do not include data at the extrema - the focus is usually near the critical point and the phase transitions.

This will be fixed in a future release, but in the meantime, users can quickly fix this themselves if it becomes a problem. Users can manually overwrite the loaded data (this is not permanent). In this example, we reset the maximum density to be 2000kg/m3.

import pyromat as pm
co2 = pm.get('mp.CO2')
>>> co2.h(T=190., p=7900.)
... raises an error ...
>>> co2.data['dlim'] = [0., 2000.]
>>> co2.h(T=190., p=7900.)
array([-64.1399237])
@chmarti1
Copy link
Owner Author

This is now resolved with new density limits in version 2.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant