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

General Inverse Property Lookup Functionality #87

Open
DasFelthaus opened this issue Mar 18, 2024 · 2 comments
Open

General Inverse Property Lookup Functionality #87

DasFelthaus opened this issue Mar 18, 2024 · 2 comments

Comments

@DasFelthaus
Copy link

Description:

Request for enhancement to add general inverse property lookup capabilities to Pyromat, enabling users to calculate properties like temperature or pressure based on other properties (e.g., entropy and quality). This feature would streamline calculations involving complex thermodynamic cycles by directly solving for states without iterative methods.

Benefits:

  • Facilitates direct solution of thermodynamic states in cycles.
  • Reduces reliance on external numerical methods for common calculations.
  • Broadens the utility of Pyromat for engineering and scientific applications.

Implementation could involve creating a generalized framework for inverse lookups that can be extended to various properties and substances. This addition would significantly enhance Pyromat's functionality and its applicability in thermodynamic analyses.

Thank you for considering this suggestion.

@chmarti1
Copy link
Owner

chmarti1 commented Jul 30, 2024

It took me a very long time to get to your request. Thank you for your patience, and thanks for your question!

I get this request a fair bit, so it deserves a good discussion. As of version 2.2.4, there is already quite a bit of flexibility in how states are defined, but it's true that some combinations are not supported. As of v2.2.4, here's what's allowed so far in the mp1 class:

e,T e,p e,d e,v e,x
h,T h,p h,d h,v h,x
s,T s,p s,d s,v s,x
T,p T,d T,v T,x T,p,x (very special case)
p,d p,v p,x
d,x
v,x

There are some combinations that are excluded for very good reasons. For example, the plot below shows enthalpy of steam as a function of temperature for x = [0.00,0.25,0.5,0.75,1.00]. In general, it is actually not theoretically correct to write T(h,x) because there are multiple temperatures that can give the same enthalpy and quality.
image

There are some more subtle issues as well. It is theoretically acceptable to specify enthalpy and temperature as a pair, but it is can be a numerical catastrophe because enthalpy is only a very weak function of density in the vapor phase.

Really there are only two kinds of valid combinations that are not currently supported:

  1. Pairs of non-basic properties (h,s or e,s)
  2. Properties not currently directly supported (like Gibbs energy of speed of sound)
    Both are absolutely "on the list" of things to do in the future.

@chmarti1
Copy link
Owner

chmarti1 commented Oct 2, 2024

There is now a more thorough discussion of these ideas here and in the handbook. It really is a valid question.

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

2 participants