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
Support density and internal energy inputs with tabular backends #2077
base: master
Are you sure you want to change the base?
Support density and internal energy inputs with tabular backends #2077
Conversation
table build step.
and enthalpy inputs.
This pull request introduces 2 alerts when merging 85a5b85 into 339a7ac - view on LGTM.com new alerts:
|
Are you planning on adding the proper two-phase detection for u-rho inputs? I have been working on this problem in my day job and have some pointers. You might also be interested in https://mediatum.ub.tum.de/doc/1633144/1633144.pdf Also, part of me wonders if it is a good idea to integrate this PR if it is not getting the right two-phase boundary. The box around the phase boundary cuts out a lot of important single-phase states. C++11 is not yet fully supported in CoolProp, can you please (sadly) remove all the C++11 features. Finally, please revert the whitespace-only changes. |
Description of the Change
An additional table for density and internal energy has been added to the tabular backends. This allows to update the state
with these inputs. This might be beneficial in numerical codes, such as CFD codes, since these inputs are calculated
from the conservation laws. Although the time to generate the tables and the storage size increase somewhat, the runtime
improves significantly compared to the HEOS calculation.
The detection of the two phase region is challenging because both inputs are not constant in this region. Currently a
complicated detection is circumvented by computing a bounding box around the two phase region. The state is assumed two
phase if it is inside this box. This is illustrated by the figure below.
Also support for second partial derivatives has been added to the tabular backends. The TTSE backend uses only
constant values from the nearest grid point, while the bicubic backend actually interpolates the result.
Benefits
Possible Drawbacks
Verification Process
Add test scripts under
CoolProp/dev/TabularBackend/
compare_tabular_backends.cxx
compare_plots.py
Applicable Issues