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

How to specify the phase in a TwoPhase Fluid #58

Closed
rclUPC opened this issue Dec 12, 2024 · 1 comment
Closed

How to specify the phase in a TwoPhase Fluid #58

rclUPC opened this issue Dec 12, 2024 · 1 comment
Labels
question Further information is requested

Comments

@rclUPC
Copy link

rclUPC commented Dec 12, 2024

Hi, sorry, but I have not clear if it is possible to specify the phase in order to compute the properties of one of the phases in a TwoPhase fluid. For instance, for water,

from pyfluids import Fluid, FluidsList, Phases, Input
fluid = "Water"
water = PF.specify_phase(Phases.Liquid).with_state(Input.pressure(10e3),Input.enthalpy(2e5))
water.density

the result is the density for the twoPhase fluid, not for only the liquid phase.

Thank you
Robert

@portyanikhin portyanikhin added the question Further information is requested label Dec 18, 2024
@portyanikhin
Copy link
Owner

portyanikhin commented Dec 18, 2024

Hello, Robert!

As far as I know, this method (specify_phase) is used by CoolProp to speed up calculations:
https://coolprop.sourceforge.net/coolprop/LowLevelAPI.html#imposing-the-phase-optional

In your case, CoolProp, instead of issuing any error (as it happens in other similar cases), for some reason resists and doesn't want to fix the phase. I don't know if this is a mistake, or if the CoolProp developers intended it that way. In any case, I can't influence it in any way.

In this case, I would advise you to take advantage of the properties of a saturated liquid. In my opinion, this is quite logical, since a two-phase fluid is simply a mixture of saturated liquid and saturated vapor in a certain proportion (which may change, for example, during evaporation).

from pyfluids import Fluid, FluidsList, Input

saturated_water = Fluid(FluidsList.Water).with_state(Input.pressure(10e3), Input.quality(0))
saturated_vapor = Fluid(FluidsList.Water).with_state(Input.pressure(10e3), Input.quality(1))

print(saturated_water.density) # 989.8332753648964
print(saturated_vapor.density) # 6.770413445120213

I hope it helped in some way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants