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
PropsSImulti in Python #848
Comments
Could you please specify which functionality your are missing? Is it the composition vector? I think that is the only part that is missing from this example: import numpy as np
import CoolProp.CoolProp as CP
fluid = "HEOS::Water"
out_lst = ["H","S"]
in1_lst = np.array([150,220])+273.15
in2_lst = np.array([0.1,0.5])*1e5
CP.PropsSI(out_lst,"T",in1_lst,"P",in2_lst,fluid) |
Yes jowr, that is correct. The example given above doesn't specify the mole or mass fraction of each fluid. Also, can you use this functionality with gases? |
Yes, the mole fraction does not work, but I think that @ibell might be able to quickly wrap What do you mean by gasses? Water for sure is in the gaseous state at 150 degrees Celsius at 0.1 bar. |
Oh, yes I didn't pay attention to the pressure and temperature in this example. That answer's my question about gases. |
Also, you can use mixtures directly in the high-level interface already, by doing things like the following examples: I acknowledge we could make the documentation clearer about how you use mixtures in CoolProp in the high-level interface. |
Those examples obviously do not allow you to pass the compositions as a vector, rather the compositions (molar!) are encoded as a string. But if you really want speed, you want to be using the low-level interface: http://www.coolprop.org/coolprop/LowLevelAPI.html. That gives you power and speed, and access to some things you can't access in the high-level interface. |
Thank you ibell for the information. the high-level interface is much easier to understand and it works fine for my need. However, I can't get the mixture I want (Helium "He" and Xenon "Xe"). I know they work separately and I know Helium can work with other gases, but Xenon seems to not work in mixtures. Is this correct? There must be a chemistry reason why Xenon's properties are difficult to get in mixtures. |
What error do you get? Probably we don't have interaction parameters for On Thu, Oct 22, 2015 at 4:59 PM, VAL333 notifications@github.com wrote:
|
I figured that was the issue. That is great that you "should have interaction parameters for about another 700 binary pairs"! CoolProp is surpassing RefProp! Here is the error I get: ValueError: Initialize failed for backend: "?", fluid: "Xe&He" fractions "[ 0.2000000000, 0.8000000000 ]"; error: Could not match the binary pair [7440-59-7,7440-63-3] - for now this is an error. : PropsSI("D","T",300,"P",101325,"Xe[0.2]&He[0.8]") |
Right, that means no interaction parameters for this mixture. I can guess that the interaction parameters should be very nearly 1, so if you were feeling adventureous, you could tell CoolProp to use a simple estimation scheme: import CoolProp
CAS_He = CoolProp.CoolProp.get_fluid_param_string('Helium','CAS')
CAS_Xe = CoolProp.CoolProp.get_fluid_param_string('Xe','CAS')
CoolProp.CoolProp.apply_simple_mixing_rule(CAS_He, CAS_Xe, 'linear')
CoolProp.CoolProp.PropsSI('Dmass','T',300,'P',101325,'Helium[0.5]&Xenon[0.5]') Use with caution!! For other mixtures this can give you entirely(!) wrong predictions |
Thank you! |
By the way, do you still want the vector PropsSI function? Or would better docs be enough? |
Better docs would be enough:) By the way, I cannot seam to access the apply_simple_mixing_rule. I get the error: AttributeError: 'module' object has no attribute 'apply_simple_mixing_rule'. But it's weird because if I use tab completion it does find the function... |
Perhaps you have somehow an older version of CoolProp hiding on your You need the nightly version, the 5.1.1 release doesn't have the On Thu, Oct 22, 2015 at 5:33 PM, VAL333 notifications@github.com wrote:
|
So, I still have the same error. When I print the CoolProp version, it says 5.1.0. Is that what it should say? |
No, it should say 5.1.2dev. I have no idea how you have 5.1.0. Something funny is going on here... Did you call "pip uninstall CoolProp" a few times at the command line? And then do the install I linked? Can you please provide the full log from the console? |
Hopefully this is enough information. Let me know if not. |
Hi @jowr,
The PropsSImulti seems increadibly useful and I would really need it for my project. However, I cannot use it in python and I believe the reason is that there is no wrapper to use it in python. Would it be possible (and relatively quick) to implement the wrapper so that PropsSImulti can be used in python?
Thank you very much.
The text was updated successfully, but these errors were encountered: