-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Triple point for abstract class - density out of range issue #10
Comments
Hi @matlawicebox, Thank you for reporting the issue. Unfortunately, I have designed this library to work with pure fluids, I actually never tried using mixtures. So right now I am not sure, as what must be done to make it work with mixtures. If you are interested in investigating this, let me know, I would be happy to assist you where I can. Also, I currently do not have access to a REFPROP license to reproduce the issue... Best Francesco |
Hi Francesco - thanks for replying.
I'm not really sure how to proceed with an investigation - I'm not sure
exactly what coolprop is doing to get that triple point information.
I started a discussion here at
https://github.com/CoolProp/CoolProp/discussions to see if anyone had any
suggestions there.
As far as I know, mixtures are supposed to work via REFPROP and abstract
states, so I would have thought the triple point information would be
accessible, but maybe not? Or maybe there's some way to constrain values
when it's doing a search? I'll let you know if I find anything.
…On Tue, May 14, 2024 at 10:38 AM Francesco Witte ***@***.***> wrote:
Hi @matlawicebox <https://github.com/matlawicebox>,
Thank you for reporting the issue. Unfortunately, I have designed this
library to work with pure fluids, I actually never tried using mixtures. So
right now I am not sure, as what must be done to make it work with
mixtures. If you are interested in investigating this, let me know, I would
be happy to assist you where I can. Also, I currently do not have access to
a REFPROP license to reproduce the issue...
Best
Francesco
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEQG6MGM5KEVPTE34XZPQWLZCJDY7AVCNFSM6AAAAABHWTRM4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQG43TSMJWGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Matthew Lawrence, PhD
Chief Science Officer
Icebox Heat Pumps
707-513-0452
|
Hi Francesco,
I did a bit more investigating and it looks like the only problem is with
that one line. I can reproduce the error if I simplify everything to 3
lines:
```python
import CoolProp as CP
R513a = CP.AbstractState('REFPROP','R1234yf&R134a');
R513a.set_mole_fractions([0.56,0.44])
p_trip = R513a.trivial_keyed_output(CP.iP_triple)
```
That gives me the same error as I see when I run fluprodia.
I then went through the rest of the lines in set_isoline_defalults, and if
I just put in a dummy value for p_trip (set it to the value for R134a),
then all the other values get populated.
Do you know how I could find an accurate value for p_trip for R513A (which
is 0.56 mole fraction R1234YF and 0.44 mole fraction R513A) that I could
just populate with an if statement based on fluid string? I did an on-line
search but seem to only be able to find critical pressures, not triple-point
Matthew
|
Hmm, well I just tried running using R134a triple point of 389.56 Pa, but
when I try that the program hangs. Force-quitting the program gives this:
Traceback (most recent call last):
File
"/opt/miniconda3/envs/CondaHP/lib/python3.8/site-packages/fluprodia/fluid_property_diagram.py",
line 957, in single_isenthalpic
self.state.update(CP.DmassHmass_INPUTS, val, h[i])
File "CoolProp/AbstractState.pyx", line 102, in
CoolProp.CoolProp.AbstractState.update
File "CoolProp/AbstractState.pyx", line 104, in
CoolProp.CoolProp.AbstractState.update
ValueError: DmolarHmolar:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/matlawicebox/Desktop/Python/CondaHeatPump/HeatPumpGUI.py",
line 668, in RunModel
Tsplot = twostagecycleTSplot(fluid, Tin, Tout, HEXcooldT, HEXevapdT,
Pmax, comp1eff, comp2eff, evaptype,
File "/Users/matlawicebox/Desktop/Python/CondaHeatPump/GUIfunctions.py",
line 470, in twostagecycleTSplot
Tsplot = Tsplotwithcycletwostage(fluid, cyclepoints, expansionmode,
plotlimits, figuresize, addtables,
File "/Users/matlawicebox/Desktop/Python/CondaHeatPump/fluidplots.py",
line 318, in Tsplotwithcycletwostage
diagram.calc_isolines()
File
"/opt/miniconda3/envs/CondaHP/lib/python3.8/site-packages/fluprodia/fluid_property_diagram.py",
line 590, in calc_isolines
self.isenthalpic()
File
"/opt/miniconda3/envs/CondaHP/lib/python3.8/site-packages/fluprodia/fluid_property_diagram.py",
line 665, in isenthalpic
self.enthalpy[h] = self.single_isenthalpic(
File
"/opt/miniconda3/envs/CondaHP/lib/python3.8/site-packages/fluprodia/fluid_property_diagram.py",
line 957, in single_isenthalpic
self.state.update(CP.DmassHmass_INPUTS, val, h[i])
KeyboardInterrupt
Any ideas what could be the issue or if there's something I could do
to debug how/where it's hanging?
Matthew
On Tue, May 14, 2024 at 4:39 PM Matthew Lawrence <
***@***.***> wrote:
…
Hi Francesco,
I did a bit more investigating and it looks like the only problem is with
that one line. I can reproduce the error if I simplify everything to 3
lines:
import CoolProp as CP
R513a = CP.AbstractState('REFPROP','R1234yf&R134a'); R513a.set_mole_fractions([0.56,0.44])
p_trip = R513a.trivial_keyed_output(CP.iP_triple)
That gives me the same error as I see when I run fluprodia.
I then went through the rest of the lines in set_isoline_defalults, and if
I just put in a dummy value for p_trip (set it to the value for R134a),
then all the other values get populated.
Do you know how I could find an accurate value for p_trip for R513A (which
is 0.56 mole fraction R1234YF and 0.44 mole fraction R513A) that I could
just populate with an if statement based on fluid string? I did an on-line
search but seem to only be able to find critical pressures, not triple-point
Matthew
On Tue, May 14, 2024 at 10:48 AM Matthew Lawrence <
***@***.***> wrote:
> Hi Francesco - thanks for replying.
>
> I'm not really sure how to proceed with an investigation - I'm not sure
> exactly what coolprop is doing to get that triple point information.
>
> I started a discussion here at
> https://github.com/CoolProp/CoolProp/discussions to see if anyone had
> any suggestions there.
>
> As far as I know, mixtures are supposed to work via REFPROP and abstract
> states, so I would have thought the triple point information would be
> accessible, but maybe not? Or maybe there's some way to constrain values
> when it's doing a search? I'll let you know if I find anything.
>
> On Tue, May 14, 2024 at 10:38 AM Francesco Witte <
> ***@***.***> wrote:
>
>> Hi @matlawicebox <https://github.com/matlawicebox>,
>>
>> Thank you for reporting the issue. Unfortunately, I have designed this
>> library to work with pure fluids, I actually never tried using mixtures. So
>> right now I am not sure, as what must be done to make it work with
>> mixtures. If you are interested in investigating this, let me know, I would
>> be happy to assist you where I can. Also, I currently do not have access to
>> a REFPROP license to reproduce the issue...
>>
>> Best
>>
>> Francesco
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#10 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/BEQG6MGM5KEVPTE34XZPQWLZCJDY7AVCNFSM6AAAAABHWTRM4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQG43TSMJWGI>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
>
> --
> Matthew Lawrence, PhD
> Chief Science Officer
> Icebox Heat Pumps
> 707-513-0452
>
--
Matthew Lawrence, PhD
Chief Science Officer
Icebox Heat Pumps
707-513-0452
--
Matthew Lawrence, PhD
Chief Science Officer
Icebox Heat Pumps
707-513-0452
|
I think, the mixture routines are quite slow. Fluprodia calculates the lines on 200 datapoints. For pure fluids, this routine might take a second or two, on mixtures this can go way beyond. Maybe try it by changing the number of datapoints and see, if that does anything. You could also benchmark the calls in a different script to get a feel for the time used. Edit: You could write a small script and call the functions as done in this function, but with less enthalpy lines and with smaller points on the iterator. fluprodia/src/fluprodia/fluid_property_diagram.py Lines 581 to 593 in 6946284
|
I did get this response about the triple point issue:
Pmin isn't a trivial output for REFPROP backend, instead Tmin is a trivial
output and then you need to do a saturation call to get the corresponding
pressure
CoolProp/CoolProp#2378
…On Fri, May 17, 2024 at 12:12 AM Francesco Witte ***@***.***> wrote:
Any ideas what could be the issue or if there's something I could do
to debug how/where it's hanging?
I think, the mixture routines are quite slow. Fluprodia calculates the
lines on 200 datapoints. For pure fluids, this routine might take a second
or two, on mixtures this can go way beyond. Maybe try it by changing the
number of datapoints and see, if that does anything. You could also
benchmark the calls in a different script to get a feel for the time used.
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEQG6MC2NCGCQHH5MISABJ3ZCWUXFAVCNFSM6AAAAABHWTRM4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJWHEYDCOBSGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Matthew Lawrence, PhD
Chief Science Officer
Icebox Heat Pumps
707-513-0452
|
I have some code that works great but I'm trying to add in some fluids that are mixtures and am now getting an error from within set_isoline_defaults.
My fluid is defined as:
self.state = CP.AbstractState('REFPROP','R1234yf&R134a'); self.state.set_mole_fractions([0.56,0.44])
And I get this error upon running:
this works fine when the state is defined as a single fluid:
self.state = CP.AbstractState('HEOS', self.fluid)
It looks like it's not a problem with any of my inputs but something to do with mixtures and triple points. Any ideas how I can get past this? Thanks!
The text was updated successfully, but these errors were encountered: