Metadata-Version: 2.4
Name: fluprodia
Version: 4.1.1
Summary: Create beautiful fluid property diagrams using CoolProp
Author-email: Francesco Witte <tespy@witte.sh>
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
License-File: LICENSE
Requires-Dist: CoolProp>=6.4
Requires-Dist: numpy>=1.13.3
Requires-Dist: pint
Requires-Dist: build ; extra == "dev"
Requires-Dist: flit ; extra == "dev"
Requires-Dist: furo ; extra == "dev"
Requires-Dist: ipykernel ; extra == "dev"
Requires-Dist: isort ; extra == "dev"
Requires-Dist: matplotlib ; extra == "dev"
Requires-Dist: nbformat ; extra == "dev"
Requires-Dist: plotly>=6.7.0 ; extra == "dev"
Requires-Dist: pytest ; extra == "dev"
Requires-Dist: sphinx>=7.2.2 ; extra == "dev"
Requires-Dist: sphinx-copybutton ; extra == "dev"
Requires-Dist: sphinx-design ; extra == "dev"
Requires-Dist: tespy ; extra == "dev"
Requires-Dist: tox ; extra == "dev"
Requires-Dist: twine ; extra == "dev"
Project-URL: Changelog, https://fluprodia.readthedocs.io/en/latest/changelog.html
Project-URL: Documentation, https://fluprodia.readthedocs.io/
Project-URL: Homepage, https://github.com/fwitte/fluprodia
Project-URL: Issue Tracker, https://github.com/fwitte/fluprodia/issues
Provides-Extra: dev

=======================
Fluid Property Diagrams
=======================

Create custom and beautiful Fluid Property Diagrams with fluprodia. The package
implements fluid property data from CoolProp [1]_. Plotting is handled by
matplotlib [2]_, all calculations are performed with numpy [3]_.
The list of fluids available can be found at
`CoolProp <http://www.coolprop.org/fluid_properties/PurePseudoPure.html#list-of-fluids>`_.

fluprodia is licensed under the MIT software license.

.. start-badges

.. list-table::
    :stub-columns: 1

    * - docs
      - |docs|
    * - package
      - | |version| |wheel|
        | |supported-versions|
        | |zenodo|

.. |docs| image:: https://readthedocs.org/projects/fluprodia/badge/?style=flat
    :target: https://readthedocs.org/projects/fluprodia
    :alt: Documentation Status

.. |version| image:: https://img.shields.io/pypi/v/fluprodia.svg
    :alt: PyPI Package latest release
    :target: https://pypi.org/project/fluprodia

.. |wheel| image:: https://img.shields.io/pypi/wheel/fluprodia.svg
    :alt: PyPI Wheel
    :target: https://pypi.org/project/fluprodia

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/fluprodia.svg
    :alt: Supported versions
    :target: https://pypi.org/project/fluprodia

.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3795771.svg
    :alt: Zenodo
    :target: https://doi.org/10.5281/zenodo.3795771

.. end-badges

Installation
============

.. code-block:: bash

    pip install fluprodia

Usage
=====

To create a diagram import the library, specify unit system and isolines to be
calculated and run the calculation:

.. code-block:: python

    >>> from fluprodia import FluidPropertyDiagram
    >>> import matplotlib.pyplot as plt
    >>> import numpy as np

    >>> diagram = FluidPropertyDiagram(fluid='H2O')
    >>> diagram.set_unit_system(T='°C', h='kJ/kg', p='bar')
    >>> Q = np.linspace(0, 1, 11)
    >>> T = np.arange(25, 501, 25)
    >>> p = np.geomspace(0.01, 1000, 6)
    >>> v = np.geomspace(0.001, 10, 5)
    >>> s = np.linspace(1000, 10000, 10)
    >>> h = np.linspace(0, 3600, 19)
    >>> diagram.set_isolines(Q=Q, T=T, p=p, v=v, s=s, h=h)
    >>> diagram.calc_isolines()

Then you can plot the data to different types of plots, e.g. logph diagram:

.. code-block:: python

    >>> fig, ax = plt.subplots(1, figsize=(8, 5))
    >>> diagram.draw_isolines(diagram_type='logph', fig=fig, ax=ax, x_min=0, x_max=3000, y_min=0.01, y_max=1000)
    >>> plt.tight_layout()
    >>> fig.savefig('logph_diagram_H2O.svg')
    >>> fig.savefig('logph_diagram_H2O.png', dpi=300)

.. figure:: https://raw.githubusercontent.com/fwitte/fluprodia/master/docs/reference/_images/logph_diagram_H2O.svg
    :align: center

Or, a Ts-diagram:

.. code-block:: python

    >>> fig, ax = plt.subplots(1, figsize=(8, 5))
    >>> diagram.draw_isolines(diagram_type='Ts', fig=fig, ax=ax, x_min=0, x_max=8000, y_min=0, y_max=700)
    >>> plt.tight_layout()
    >>> fig.savefig('Ts_diagram_H2O.svg')
    >>> fig.savefig('Ts_diagram_H2O.png', dpi=300)

.. figure:: https://raw.githubusercontent.com/fwitte/fluprodia/master/docs/reference/_images/Ts_diagram_H2O.svg
    :align: center

The fluids are available through CoolProp. To generate a diagram for a new fluid
simply change the name. Isolines come with defaults as well.

.. code-block:: python

    >>> diagram = FluidPropertyDiagram(fluid='R290')
    >>> diagram.set_unit_system(T='°C', h='kJ/kg', p='bar')
    >>> diagram.calc_isolines()
    >>> fig, ax = plt.subplots(1, figsize=(8, 5))
    >>> diagram.draw_isolines(diagram_type='logph', fig=fig, ax=ax, x_min=0, x_max=800, y_min=1e-1, y_max=1e2)
    >>> plt.tight_layout()
    >>> fig.savefig('logph_diagram_R290.png', dpi=300)
    >>> fig.savefig('logph_diagram_R290.svg')

.. figure:: https://raw.githubusercontent.com/fwitte/fluprodia/master/docs/reference/_images/logph_diagram_R290.svg
    :align: center

You can change the back-end of CoolProp, e.g. to use REFPROP:

.. code-block:: python

    diagram = FluidPropertyDiagram(fluid='R290', backend='REFPROP')

Documentation
=============

For further examples and usage please refer to the online documentation at
https://fluprodia.readthedocs.io/.

Citation
========

Every version of fluprodia is archived at zenodo. You can cite the latest or
a specific version. For citation info and more details please go to the
`zenodo entry <https://zenodo.org/record/3795771>`_ of fluprodia.

References
==========

This software depends on the packages CoolProp, matplolib and numpy.

.. [1] Bell, I., Wronski, J., Quoilin, S. and Lemort, V., 2014. Pure and Pseudo-pure Fluid Thermophysical Property Evaluation and the Open-Source Thermophysical Property Library CoolProp. *Industrial & Engineering Chemistry Research*, 53(6), pp. 2498-2508.
.. [2] Hunter, J., 2007. Matplotlib: A 2D Graphics Environment. *Computing in Science & Engineering*, 9(3), pp. 90-95.
.. [3] van der Walt, S., Colbert, S. and Varoquaux, G., 2011. The NumPy Array: A Structure for Efficient Numerical Computation. *Computing in Science & Engineering*, 13(2), pp. 22-30.

