Replies: 3 comments
-
This is a perennial issue, in my experience. The Python interfaces for the the thermodynamic tools I've experimented with tend to be rather literal translations of their C/C++ APIs, which means that looping is dreadful. They're fine for extracting individual numbers, but not for the vast arrays of values needed by multidimensional phase field or reaction diffusion problems. I don't have experience with CoolProp , but know @ibell, one of the lead authors, who may have some ideas on how to improve throughput. |
Beta Was this translation helpful? Give feedback.
-
It depends, as usual. If you want to evaluate the EOS, in the form
p(T,rho), then you may see a benefit from vectorization, but that is by no
means guaranteed. Any other sorts of inputs require iteration for each
input so vectorization is out.
Sorry to not have better news.
If you want, feel free to shoot me an email and I can expand in detail.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your input! I might come back to your offer @ibell |
Beta Was this translation helpful? Give feedback.
-
This is more a general question, rather than an issue. Do you have a recommendation for integrating an efficient library for the numpy-based calculation of thermodynamic properties of gas mixtures?
So far I tried Cantera and CoolProp, however their Python APIs do not support direct array evaluations (superficially they do, but similarly slow (Cantera) or much slower (High-level interface from CoolProp) than using native Python looping), which I would expect to decrease the overall performance of FiPy simulations dramatically.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions