Commit Graph

408 Commits

Author SHA1 Message Date
Ian Bell
559a8cbaf3 pseudo-pure refrigerants should not have superancillaries
See #2568
2025-07-04 19:15:03 -04:00
Ian Bell
02162b3e47 Fix melting lines so they can be evaluated at pmax 2025-06-15 09:25:03 -04:00
Ian Bell
df23e1c568 Fix reference states to match REFPROP 10.0
Something weird with incbin not pulling in new version of file
2025-06-15 09:07:07 -04:00
Ian Bell
264c816ad7 Clean up the fluid files 2025-06-14 16:00:40 -04:00
Ian Bell
0734e5759f R1336MZZE is not available in REFPROP 10.0, so disable the REFPROP name for now 2025-05-18 19:37:36 -04:00
Ian Bell
267d64533a Superancillaries for pure fluids (#2511)
* Expansions are fully wrapped, looking good. Next step is the set of expansions that is the 1D approximation

* Get 1D approx working via cython

* Count solutions

* SuperAncillary class is working

>1000x speedup for water
Time for C++!

* Superancillaries are working!

In C++, speedup is more than 2000x. In Python, more like 150x because of Python <-> C++ overhead

* Add pmax check for PQ superancillary calls

* Update tests

* Allow T limits to be obtained

* Implement get_fluid_parameter_double for getting superanc value

* Add tests for getting parameters from superanc

* Script for testing superancillaries for sphinx

* Microoptimizations; don't help speed

The limiting factor remains the clear function, which takes about 30 ns

* Add R125 superancillary

* Use the release from fastchebpure for the files

* Drop a .gitignore in the unzipped folder

* Update superancillary injection script

* Turn on superancillaries by default

* Missing header

* Many int conversions in superancillary

* Another int cast

* More annoying solution for boost iter max

* Fix warnings

* One more warning

* Clear up the calculation of rho

* Update docs_docker-build.yml

Use arm64 since the containers were built on mac

* Superfluous ;

* Update backend.py

* Get the critical points working for superancillaries

* Fix wrapping changes of xmin&xmax methods

* squelch warnings

* Version 0 of jupyter notebook for docs

* Try to add the notebook to the docs

* Add jupyter notebook for superancillary

* Lots of updates to superancillary notebook

* More updates to docs

* Skip pseudo-pure for superancillary docs

* Fix output of superancillary figures

* Add superancillary plots to docs for the page for each fluid

* Make a placeholder figure for fluids without superancillary

* Add superancillary plots to task list

* Bump to release fixing m-xylene

* Relax the location of the REFPROP stuff

* Change default name for R-1336mzz(E)

* No need for figures to be so large

* Don't need REFPROP setting

* Bump to fastchebpure release with methanol

* Benchmark caching options

* Benchmark more granularly

* Add the fast methods to public API for HEOS class

* Back to memset - can memset with 0 but no other value

* Fix how caching is managed in Helmholtz class

* Close to final implementation

Perhaps a tiny bit more optimization possible?

* Update function name

* Make message more accurate

* Fix init order

* Expose update_QT_pure_superanc to Python

* Fix when _reducing is set for pures

* Fix the post_update

* Indent

* Notebook

* Notebook

* Make ln(p) construction lazy

Only really matters for debug builds

* Also make reference non-const

* Inject superancillary for methanol

* Make the superancillary loading entirely lazy in debug

* Fix PH bug for Nitrogen

 Closes #2470

* Force the clear to be called on SatL and SatV

To invalidate them at start

* Default is non-lazy superancillary loading

* Add CMake option to have lazy-loading superancillaries [skip ci]

Not a good idea unless doing very narrow testing
2025-05-17 20:27:19 -04:00
Ian Bell
629dab9646 Update states 2025-05-17 15:40:19 -04:00
Ian Bell
71c4d24768 Switch methanol to the EOS of de Reuck to match REFPROP
Closes #2538
2025-04-27 09:26:36 -04:00
Ian Bell
a72baafc77 Add fluid files with superancillary data (#2503)
* Add fluid files with superancillary data

* Delete the large generated z-compressed header
2025-03-22 21:33:18 -04:00
Ian Bell
f6f1279c8d Silence a lot of tests that are not serious problems
See #2484
2025-03-02 14:00:15 -05:00
Ian Bell
d04e24d62d Update a bunch of states, especially the h,s anchors 2025-02-23 16:47:20 -05:00
Ian Bell
4d1de18261 Fix h,s anchor state for pentane
Closes #1870
Closes #2477
2025-02-23 16:40:52 -05:00
Ian Bell
f86cff92ec Fix critical density for cyclopentane
Should have also been updated when updating the EOS
2024-08-29 08:58:12 -04:00
Ian Bell
56b09a6b75 Fix InChi string/key for R1233zd(E)
Previous values were for the mixture of Z and E isomers
2024-08-05 14:43:15 -04:00
Ian Bell
f6eb03742f Copy the viscosity correlation into parahydrogen
Paper indicates it is valid for normal H2 and para-H2
Closes #2371
2024-04-21 09:51:17 -04:00
Ian Bell
0f423dcd20 Go back to the correct ancillary function from Gao
I had the wrong flag for using_tau_r previously

See https://github.com/CoolProp/CoolProp/issues/2356
2024-02-25 10:27:20 -05:00
msaitta-mpr
443a2fd276 Catch singular explosions in saturation_PHSU_pure (#2250)
* Catch singular explosions in saturation_PHSU_pure

Sometimes, the Akasaka solver has issues. This is usually caught and
then it is retried with a new omega. However, sometimes it goes bad
because the J matrix is singular, and this is not caught because the
error is not recalculated.

This commit recalculates the error term to prevent a bad result.

* Add comment to explain error check in saturation_PHSU_pure

* Add extra update check after saturation_PHSU_pure

During saturated PHSU flash calculations, SatL and SatV states have an
imposed phase. This is good for stability, but there is a small chance
that they can both up up with a matching third variable (e.g.,
pressure) that is not actually at the saturation point. This commit
forces a final DT update without this requirement. If an actual solution
has been found, the the error term will still be small. If not, then we
throw an exception and try again.

This continues work on #2245.

* Ensure that saturated phase is specified

In saturation_PHSU_pure, we unspecify the phase of SatL and SatV to
perform a final check. However, for any future updates, these states
*must* be set with specified phase. This commit ensures that no matter
what happens (exception, etc.) the phase is always specified again.

* Revert "Ensure that saturated phase is specified"

This reverts commit c6b650b861.

The commit caused potential recursive lookups and did not solve the
issue at hand.

* Update the ammonio saturated rhoV ancillary

The rhoV ancillary gave somewhat wrong results. This commit provides a
closer fit that prevents errors downstream.
2024-01-15 19:51:04 -05:00
Ian Bell
ffa5a278ab Fix the triple points densities for R-1336mzz(E) (#2329) 2023-12-06 14:08:13 +01:00
Jorrit Wronski
72e0baae5c Rename R1336mzz(E).json_disabled to R1336mzz(E).json
Prepare for merging #2329
2023-12-06 14:08:00 +01:00
Jorrit Wronski
337526d056 Temporarily remove R1336mzz(E) from the list of fluids until #2309 is fixed 2023-11-29 13:42:16 +01:00
Jonas Freißmann
ce9c3e57e4 Addition of EoS JSON of R1336mzz(E) from Akasaka-IJT-2023 (#2309)
* Add EOS JSON for R1336mzz(E) from Akasaka-IJT-2023.

* Add BibTeX entry for Akasaka-IJT-2023.

* Add BibTeX_EOS label in R1336mzz(E).json.

* Update R1336mzz(E).json

Fix the triple point liquid density, without it, VLE calculations fail

---------

Co-authored-by: Ian Bell <ian.h.bell@gmail.com>
2023-11-27 21:32:20 -05:00
Arnab Mahanti
826e77f122 implemented VISC LAESECK-JPCRD-2017-CO2 (#2268) 2023-07-26 10:53:06 -04:00
Arnab Mahanti
377bab8ebe implemented TCX Huber-JPCRD-2016 for CO2 (#2267)
* implemented TCX Huber-JPCRD-2016 for CO2

* added CarbonDioxideHuberJPCRD2016 to json file

* fixed typo in Huber Eq. 3
2023-07-22 07:49:23 -04:00
msaitta-mpr
3b51038827 Correct typo in n-Hexane rhoV auxilliary (#2230)
The rhoV auxilliary for n-Hexane had accidentally been set to use
reduced tau. This commit fixes the typo. This prevents bad guesses
for a number of property evaluations which use saturated states.
2023-03-29 20:31:28 -04:00
Andrés Riedemann
abcb4a53a9 update cyclopentane.json (#2225)
following the suggestion on #2051
2023-03-21 22:08:26 -04:00
msaitta-mpr
7da86af494 Topic 2142 (#2223)
* Remove R1233zd(E) hL ancillary

The R1233zd(E) hL ancillary performs poorly. This can result in a
failure to converge when provided inputs (p/h) lie between the
ancillary saturation curve and the true saturation curve. Removing
the ancillary makes CoolProp fall back to a robust saturation
solver.

* Add 0.01 K cushion to Tmax in HSU_P_flash

Within HSU_P_flash, if an ancillary is used it can have a small
error. If the point of interest is near that saturation curve, this
error can prevent the solver from converging. Adding a 0.01 K margin
account for small ancillary errors and allow the solver to converge.

* Correct 0.01K cushion

The 0.01K adjustment should increase the potential range of the
solver. Previously, the minimum was increased, but it should be
decreased.
2023-03-18 08:07:59 -06:00
Ian Bell
be204ce8d5 Implement ancillary equation for ammonia. See #2049 2021-10-24 13:29:17 -04:00
Ian Bell
fe7f6db631 Fix rounding for reducing density for nitrogen; closes #2055 2021-10-24 13:14:08 -04:00
Ian Bell
02746ef456 Fix reducing density for R236ea; #2054
Had been truncated to too few digits
2021-10-24 13:13:07 -04:00
Ian Bell
e6ba7dbee5 Fix typo in last digit for water; closes #2053 2021-10-24 13:10:58 -04:00
Ian Bell
6ce0cac5c3 Fix critical temperature for R-1234ze(E)
Simple typo, not updated when copying from old model
2020-12-29 17:03:11 -05:00
Ian Bell
aae0a21f83 Update nitrogen cp0
See #1982
2020-11-25 19:18:18 -05:00
Ian Bell
cc28edee96 Fix Methane cp0
See #1982
2020-11-25 18:26:28 -05:00
Ian Bell
f7dffbc04b Lay groundwork for cp0 to agree exactly with REFPROP and TREND
See #1982
2020-11-25 18:18:48 -05:00
ian
6ed825635e Fix REFPROP names for three fluids 2020-11-22 10:08:57 -05:00
ian
5c5ee7df47 Fix alias for R1243zf; closes #1980 2020-11-11 18:48:57 -05:00
Ian Bell
c903676096 Add aliases for R-1234ze(Z) 2020-10-21 19:50:32 -04:00
ian
158c3ed3d7 Fix Nitrogen reducing density; closes #1974 2020-10-14 19:51:08 -04:00
Ian Bell
a70719ccb6 update the critical state for ammonia to match reducing state; closes #1962 2020-08-08 12:36:38 -04:00
ian
c12ebbd6ea Add new EOS for ammonia 2019-11-06 20:18:05 -07:00
ian
ea0c03b829 Add updated EOS of Ortiz-Vega 2019-10-17 19:06:40 -06:00
Ian Bell
036f3206f5 Add some convenience aliases for normal alkanes 2019-06-29 15:53:16 -06:00
Ian Bell
02d2da7971 Tidy up whitespace according to python 3 JSON module 2019-01-27 15:55:32 -07:00
Ian Bell
18526e4056 Update EOS for hexane, octane, pentane 2019-01-27 15:53:22 -07:00
Ian Bell
978074b9bf Fix reference state for MD4M 2019-01-24 14:46:29 -07:00
Ian Bell
42fe042d57 Add new EOS for D5 of Thol et al. 2019-01-24 14:45:26 -07:00
Ian Bell
db8213dc46 Fix limits for MD4M 2019-01-22 21:08:56 -07:00
Ian Bell
cf8b323a77 Fix ancillaries and HS anchor for heavy water 2019-01-21 20:55:26 -07:00
Ian Bell
7eda0d237c Add more HS anchors 2019-01-21 20:45:41 -07:00
Ian Bell
e25497a856 Update some HS anchors 2019-01-21 20:11:51 -07:00