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

An error occurred while calculating the gas mixture #30

Closed
funzeng opened this issue Sep 14, 2023 · 2 comments
Closed

An error occurred while calculating the gas mixture #30

funzeng opened this issue Sep 14, 2023 · 2 comments

Comments

@funzeng
Copy link

funzeng commented Sep 14, 2023

from pyfluids import Mixture, Fluid, FluidsList, Input

mix = Mixture([FluidsList.Methane,FluidsList.Hydrogen],[60, 40]).with_state(Input.pressure(200e+03), Input.temperature(30),)
print(mix.specific_heat)
print(mix.compressibility)

ValueError: One stationary point (not good) for T=303.15,p=200000,z=[ 0.228681059385, 0.771318940615 ]

@funzeng funzeng closed this as completed Sep 14, 2023
@minger88
Copy link

minger88 commented Nov 2, 2023

I'm also having this issue.

`
from pyfluids import Fluid, FluidsList, Input

air = Mixture([FluidsList.Nitrogen, FluidsList.Oxygen], [60, 40]).with_state(
Input.pressure(25.3e5), Input.temperature(500) )
print(air.as_json())`

`

ValueError Traceback (most recent call last)
/tmp/ipykernel_31964/3330669777.py in
1 from pyfluids import Fluid, FluidsList, Input
2
----> 3 air = Mixture([FluidsList.Nitrogen, FluidsList.Oxygen], [60, 40]).with_state(
4 Input.pressure(25.3e5), Input.temperature(500) )
5 print(air.as_json())

~/.local/lib/python3.8/site-packages/pyfluids/fluids/abstract_fluid.py in with_state(self, first_input, second_input)
322 """
323 fluid = self.factory()
--> 324 fluid.update(first_input, second_input)
325 return fluid
326

~/.local/lib/python3.8/site-packages/pyfluids/fluids/abstract_fluid.py in update(self, first_input, second_input)
336 raise ValueError("Need to define 2 unique inputs!")
337 self.reset()
--> 338 self._backend.update(
339 *generate_update_pair(
340 first_input.coolprop_key,

CoolProp/AbstractState.pyx in CoolProp.CoolProp.AbstractState.update()

CoolProp/AbstractState.pyx in CoolProp.CoolProp.AbstractState.update()

ValueError: One stationary point (not good) for T=773.15,p=2.53e+06,z=[ 0.660344557162, 0.339655442838 ]
`

Doing either Nitrogen or Oxygen as a pure fluid works just fine
`from pyfluids import Fluid, FluidsList, Input

air = Fluid(FluidsList.Oxygen).with_state(
Input.pressure(25.3e5), Input.temperature(500) )
print(air.as_json())`

@portyanikhin
Copy link
Owner

portyanikhin commented Nov 7, 2023

Hello, @funzeng, @minger88!

You are facing the error of CoolProp itself, not PyFluids.

Judging by the error message, this is due to the fact that the calculations did not converge. As far as I understand, the equations of state for mixtures have much more restrictions than the equations of state for pure fluids.

I think you can recreate this error using pure CoolProp (because CoolProp developers are most likely not familiar with PyFluids), and open an issue in the CoolProp repository. CoolProp developers will be able to answer in more detail.

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

No branches or pull requests

3 participants