fluidprop


Namefluidprop JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/Dennis-van-Gils/python-fluidprop/
SummaryEasy access to thermodynamic fluid properties as a function of temperature and pressure. With a minimal command-line interface.
upload_time2024-05-12 12:16:20
maintainerNone
docs_urlNone
authorDennis van Gils
requires_python>=3.9
licenseMIT
keywords coolprop fluids thermodynamic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |pypi| |python| |black| |license|

.. |pypi| image:: https://img.shields.io/pypi/v/fluidprop
    :target: https://pypi.org/project/fluidprop
.. |python| image:: https://img.shields.io/pypi/pyversions/fluidprop
    :target: https://pypi.org/project/fluidprop
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
.. |license| image:: https://img.shields.io/badge/License-MIT-purple.svg
    :target: https://github.com/Dennis-van-Gils/python-dvg-devices/blob/master/LICENSE.txt

fluidprop
=========
Easy access to thermodynamic fluid properties as a function of temperature and
pressure. Comes with a minimal command-line interface for quick inspection.
Provides class ``FluidProperties()`` useful for working out dataseries in your
own scripts.

- Github: https://github.com/Dennis-van-Gils/python-fluidprop
- PyPI: https://pypi.org/project/fluidprop

Installation::

    pip install fluidprop

or if you're on macOS or Linux, try::

    pip3 install fluidprop

EOS models
----------

Thermodynamic properties are provided by CoolProp, the open-source alternative
to `NIST refprop <https://www.nist.gov/srd/refprop>`_, with most of the calculations relying on the same
equation-of-state (EOS) models as refprop.

* http://www.coolprop.org/
* http://pubs.acs.org/doi/abs/10.1021/ie4033999

Command-line interface
======================

You can run this module from the terminal with::

    python -m fluidprop

or if you're on macOS or Linux, try::

    python3 -m fluidprop

It will show a minimal command-line interface which guides the user to enter a
fluid, temperature and pressure. It will print out its thermodynamic properties
as a table to the terminal.

Example output::

    https://github.com/Dennis-van-Gils/python-fluidprop
    Thermodynamic properties by CoolProp v6.6.0
    http://pubs.acs.org/doi/abs/10.1021/ie4033999

    All known fluids:
        0 | 1-Butene             41 | MD4M                 82 | R1233zd(E)
        1 | Acetone              42 | MDM                  83 | R1234yf
        2 | Air                  43 | Methane              84 | R1234ze(E)
        3 | Ammonia              44 | Methanol             85 | R1234ze(Z)
        4 | Argon                45 | MethylLinoleate      86 | R124
        5 | Benzene              46 | MethylLinolenate     87 | R1243zf
        6 | CarbonDioxide        47 | MethylOleate         88 | R125
        7 | CarbonMonoxide       48 | MethylPalmitate      89 | R13
        8 | CarbonylSulfide      49 | MethylStearate       90 | R134a
        9 | cis-2-Butene         50 | MM                   91 | R13I1
       10 | CycloHexane          51 | n-Butane             92 | R14
       11 | Cyclopentane         52 | n-Decane             93 | R141b
       12 | CycloPropane         53 | n-Dodecane           94 | R142b
       13 | D4                   54 | n-Heptane            95 | R143a
       14 | D5                   55 | n-Hexane             96 | R152A
       15 | D6                   56 | n-Nonane             97 | R161
       16 | Deuterium            57 | n-Octane             98 | R21
       17 | Dichloroethane       58 | n-Pentane            99 | R218
       18 | DiethylEther         59 | n-Propane           100 | R22
       19 | DimethylCarbonate    60 | n-Undecane          101 | R227EA
       20 | DimethylEther        61 | Neon                102 | R23
       21 | Ethane               62 | Neopentane          103 | R236EA
       22 | Ethanol              63 | Nitrogen            104 | R236FA
       23 | EthylBenzene         64 | NitrousOxide        105 | R245ca
       24 | Ethylene             65 | Novec649            106 | R245fa
       25 | EthyleneOxide        66 | o-Xylene            107 | R32
       26 | Fluorine             67 | OrthoDeuterium      108 | R365MFC
       27 | HeavyWater           68 | OrthoHydrogen       109 | R40
       28 | Helium               69 | Oxygen              110 | R404A
       29 | HFE143m              70 | p-Xylene            111 | R407C
       30 | Hydrogen             71 | ParaDeuterium       112 | R41
       31 | HydrogenChloride     72 | ParaHydrogen        113 | R410A
       32 | HydrogenSulfide      73 | Propylene           114 | R507A
       33 | IsoButane            74 | Propyne             115 | RC318
       34 | IsoButene            75 | R11                 116 | SES36
       35 | Isohexane            76 | R113                117 | SulfurDioxide
       36 | Isopentane           77 | R114                118 | SulfurHexafluoride
       37 | Krypton              78 | R115                119 | Toluene
       38 | m-Xylene             79 | R116                120 | trans-2-Butene
       39 | MD2M                 80 | R12                 121 | Water
       40 | MD3M                 81 | R123                122 | Xenon

    Enter fluid number: 121
    Enter temperature | T ['C]  : 20
    Enter pressure    | P [bar] : a
    Enter pressure    | P [atm] : 1

    ------------------------------------------------------------
    Liquid: Water (H₂O)
    @ Temperature | T =   20.000 'C = 293.150 K
    @ Pressure    | P =    1.013 bar
    ------------------------------------------------------------
        Molecular weight       | MW      = 18.01527    g/mol
        Density                | rho     = 9.982e+02   kg/m^3
        Kinematic viscosity    | nu      = 1.003e-06   m^2/s
        Dynamic   viscosity    | eta     = 1.002e-03   kg/(m s)
        Thermal exp. coeff.    | alpha   = 2.068e-04   1/K
        Thermal diffusivity    | kappa   = 1.432e-07   m^2/s
        Thermal conductivity   | lambda_ = 5.980e-01   W/(m K)
        Isobaric  heat capac.  | Cp      = 4.184e+03   J/(kg K)
        Isochoric heat capac.  | Cv      = 4.157e+03   J/(kg K)
        Isothermal compress.   | comp    = 4.589e-10   1/Pa
        Prandtl                | Pr      = 7.008
    ------------------------------------------------------------

When asked to enter the temperature in ``['C]``, you can *once* enter a single
character instead to change the input unit to::

    k | [K]     Kelvin                  K + 273.15 'C
    f | ['F]    Degrees Fahrenheit      ('F - 32) * 5 / 9 'C

When asked to enter the pressure in ``[bar]``, you can *once* enter a single
character instead to change the input unit to::

    a | [atm]   Atmosphere              = 1.01325 bar
    m | [mmHg]  Millimeter mercury      ≈ 1 atm / 760
    p | [psi]   Pounds per square inch  = 1 / 14.504 bar
    t | [torr]  Torr                    = 1 atm / 760

FluidProperties()
=================

This class evaluates thermodynamic fluid properties of the given fluid at the
given temperature(s) in ``['C]`` and pressure(s) in ``[bar]``. The results are
stored as properties to this class as ``numpy.ndarray`` arrays. Useful for
working out dataseries.

Example:

.. code-block:: python

    from fluidprop import FluidProperties

    fluid = FluidProperties("Water", 20, 1)
    print(fluid.rho)  # [998.2065435]

    fluid = FluidProperties("Water", [20, 21, 22], 1)
    print(fluid.rho)  # [998.2065435  997.99487638 997.77288644]

List of stored properties::

    coolprop_name (str): CoolProp name of the fluid.

    formula       (str): Chemical formula of the fluid.

    MW      (float)  : Molecular weight               [kg/mol]

    T       (ndarray): Evaluated temperature          [K]

    P       (ndarray): Evaluated pressure             [Pa]

    rho     (ndarray): Density                        [kg/m^3]

    nu      (ndarray): Kinematic viscosity            [m^2/s]

    eta     (ndarray): Dynamic/shear viscosity        [kg/(m s)]

    alpha   (ndarray): Thermal expansion coefficient  [1/K]

    kappa   (ndarray): Thermal diffusivity            [m^2/s]

    lambda_ (ndarray): Thermal conductivity           [W/(m K)]

    Cp      (ndarray): Isobaric heat capacity         [J/(kg K)]

    Cv      (ndarray): Isochoric heat capacity        [J/(kg K)]

    comp    (ndarray): Isothermal compressibility     [1/Pa]

    Pr      (ndarray): Prandtl number                 [-]

Dennis van Gils, 12-05-2024

Changelog
=========

1.1.0 (2024-05-12)
------------------
* Added field `Cv`: Isochoric heat capacity
* Added field `comp`: Isothermal compressibility

1.0.0 (2024-05-11)
------------------
* Initial release

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Dennis-van-Gils/python-fluidprop/",
    "name": "fluidprop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "CoolProp, fluids, thermodynamic",
    "author": "Dennis van Gils",
    "author_email": "vangils.dennis@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/24/96/51c11ea5cf64da473e7fc76cdcc6632b695e63e730f8b054f78ca5add14a/fluidprop-1.1.0.tar.gz",
    "platform": null,
    "description": "|pypi| |python| |black| |license|\r\n\r\n.. |pypi| image:: https://img.shields.io/pypi/v/fluidprop\r\n    :target: https://pypi.org/project/fluidprop\r\n.. |python| image:: https://img.shields.io/pypi/pyversions/fluidprop\r\n    :target: https://pypi.org/project/fluidprop\r\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\r\n    :target: https://github.com/psf/black\r\n.. |license| image:: https://img.shields.io/badge/License-MIT-purple.svg\r\n    :target: https://github.com/Dennis-van-Gils/python-dvg-devices/blob/master/LICENSE.txt\r\n\r\nfluidprop\r\n=========\r\nEasy access to thermodynamic fluid properties as a function of temperature and\r\npressure. Comes with a minimal command-line interface for quick inspection.\r\nProvides class ``FluidProperties()`` useful for working out dataseries in your\r\nown scripts.\r\n\r\n- Github: https://github.com/Dennis-van-Gils/python-fluidprop\r\n- PyPI: https://pypi.org/project/fluidprop\r\n\r\nInstallation::\r\n\r\n    pip install fluidprop\r\n\r\nor if you're on macOS or Linux, try::\r\n\r\n    pip3 install fluidprop\r\n\r\nEOS models\r\n----------\r\n\r\nThermodynamic properties are provided by CoolProp, the open-source alternative\r\nto `NIST refprop <https://www.nist.gov/srd/refprop>`_, with most of the calculations relying on the same\r\nequation-of-state (EOS) models as refprop.\r\n\r\n* http://www.coolprop.org/\r\n* http://pubs.acs.org/doi/abs/10.1021/ie4033999\r\n\r\nCommand-line interface\r\n======================\r\n\r\nYou can run this module from the terminal with::\r\n\r\n    python -m fluidprop\r\n\r\nor if you're on macOS or Linux, try::\r\n\r\n    python3 -m fluidprop\r\n\r\nIt will show a minimal command-line interface which guides the user to enter a\r\nfluid, temperature and pressure. It will print out its thermodynamic properties\r\nas a table to the terminal.\r\n\r\nExample output::\r\n\r\n    https://github.com/Dennis-van-Gils/python-fluidprop\r\n    Thermodynamic properties by CoolProp v6.6.0\r\n    http://pubs.acs.org/doi/abs/10.1021/ie4033999\r\n\r\n    All known fluids:\r\n        0 | 1-Butene             41 | MD4M                 82 | R1233zd(E)\r\n        1 | Acetone              42 | MDM                  83 | R1234yf\r\n        2 | Air                  43 | Methane              84 | R1234ze(E)\r\n        3 | Ammonia              44 | Methanol             85 | R1234ze(Z)\r\n        4 | Argon                45 | MethylLinoleate      86 | R124\r\n        5 | Benzene              46 | MethylLinolenate     87 | R1243zf\r\n        6 | CarbonDioxide        47 | MethylOleate         88 | R125\r\n        7 | CarbonMonoxide       48 | MethylPalmitate      89 | R13\r\n        8 | CarbonylSulfide      49 | MethylStearate       90 | R134a\r\n        9 | cis-2-Butene         50 | MM                   91 | R13I1\r\n       10 | CycloHexane          51 | n-Butane             92 | R14\r\n       11 | Cyclopentane         52 | n-Decane             93 | R141b\r\n       12 | CycloPropane         53 | n-Dodecane           94 | R142b\r\n       13 | D4                   54 | n-Heptane            95 | R143a\r\n       14 | D5                   55 | n-Hexane             96 | R152A\r\n       15 | D6                   56 | n-Nonane             97 | R161\r\n       16 | Deuterium            57 | n-Octane             98 | R21\r\n       17 | Dichloroethane       58 | n-Pentane            99 | R218\r\n       18 | DiethylEther         59 | n-Propane           100 | R22\r\n       19 | DimethylCarbonate    60 | n-Undecane          101 | R227EA\r\n       20 | DimethylEther        61 | Neon                102 | R23\r\n       21 | Ethane               62 | Neopentane          103 | R236EA\r\n       22 | Ethanol              63 | Nitrogen            104 | R236FA\r\n       23 | EthylBenzene         64 | NitrousOxide        105 | R245ca\r\n       24 | Ethylene             65 | Novec649            106 | R245fa\r\n       25 | EthyleneOxide        66 | o-Xylene            107 | R32\r\n       26 | Fluorine             67 | OrthoDeuterium      108 | R365MFC\r\n       27 | HeavyWater           68 | OrthoHydrogen       109 | R40\r\n       28 | Helium               69 | Oxygen              110 | R404A\r\n       29 | HFE143m              70 | p-Xylene            111 | R407C\r\n       30 | Hydrogen             71 | ParaDeuterium       112 | R41\r\n       31 | HydrogenChloride     72 | ParaHydrogen        113 | R410A\r\n       32 | HydrogenSulfide      73 | Propylene           114 | R507A\r\n       33 | IsoButane            74 | Propyne             115 | RC318\r\n       34 | IsoButene            75 | R11                 116 | SES36\r\n       35 | Isohexane            76 | R113                117 | SulfurDioxide\r\n       36 | Isopentane           77 | R114                118 | SulfurHexafluoride\r\n       37 | Krypton              78 | R115                119 | Toluene\r\n       38 | m-Xylene             79 | R116                120 | trans-2-Butene\r\n       39 | MD2M                 80 | R12                 121 | Water\r\n       40 | MD3M                 81 | R123                122 | Xenon\r\n\r\n    Enter fluid number: 121\r\n    Enter temperature | T ['C]  : 20\r\n    Enter pressure    | P [bar] : a\r\n    Enter pressure    | P [atm] : 1\r\n\r\n    ------------------------------------------------------------\r\n    Liquid: Water (H\u2082O)\r\n    @ Temperature | T =   20.000 'C = 293.150 K\r\n    @ Pressure    | P =    1.013 bar\r\n    ------------------------------------------------------------\r\n        Molecular weight       | MW      = 18.01527    g/mol\r\n        Density                | rho     = 9.982e+02   kg/m^3\r\n        Kinematic viscosity    | nu      = 1.003e-06   m^2/s\r\n        Dynamic   viscosity    | eta     = 1.002e-03   kg/(m s)\r\n        Thermal exp. coeff.    | alpha   = 2.068e-04   1/K\r\n        Thermal diffusivity    | kappa   = 1.432e-07   m^2/s\r\n        Thermal conductivity   | lambda_ = 5.980e-01   W/(m K)\r\n        Isobaric  heat capac.  | Cp      = 4.184e+03   J/(kg K)\r\n        Isochoric heat capac.  | Cv      = 4.157e+03   J/(kg K)\r\n        Isothermal compress.   | comp    = 4.589e-10   1/Pa\r\n        Prandtl                | Pr      = 7.008\r\n    ------------------------------------------------------------\r\n\r\nWhen asked to enter the temperature in ``['C]``, you can *once* enter a single\r\ncharacter instead to change the input unit to::\r\n\r\n    k | [K]     Kelvin                  K + 273.15 'C\r\n    f | ['F]    Degrees Fahrenheit      ('F - 32) * 5 / 9 'C\r\n\r\nWhen asked to enter the pressure in ``[bar]``, you can *once* enter a single\r\ncharacter instead to change the input unit to::\r\n\r\n    a | [atm]   Atmosphere              = 1.01325 bar\r\n    m | [mmHg]  Millimeter mercury      \u2248 1 atm / 760\r\n    p | [psi]   Pounds per square inch  = 1 / 14.504 bar\r\n    t | [torr]  Torr                    = 1 atm / 760\r\n\r\nFluidProperties()\r\n=================\r\n\r\nThis class evaluates thermodynamic fluid properties of the given fluid at the\r\ngiven temperature(s) in ``['C]`` and pressure(s) in ``[bar]``. The results are\r\nstored as properties to this class as ``numpy.ndarray`` arrays. Useful for\r\nworking out dataseries.\r\n\r\nExample:\r\n\r\n.. code-block:: python\r\n\r\n    from fluidprop import FluidProperties\r\n\r\n    fluid = FluidProperties(\"Water\", 20, 1)\r\n    print(fluid.rho)  # [998.2065435]\r\n\r\n    fluid = FluidProperties(\"Water\", [20, 21, 22], 1)\r\n    print(fluid.rho)  # [998.2065435  997.99487638 997.77288644]\r\n\r\nList of stored properties::\r\n\r\n    coolprop_name (str): CoolProp name of the fluid.\r\n\r\n    formula       (str): Chemical formula of the fluid.\r\n\r\n    MW      (float)  : Molecular weight               [kg/mol]\r\n\r\n    T       (ndarray): Evaluated temperature          [K]\r\n\r\n    P       (ndarray): Evaluated pressure             [Pa]\r\n\r\n    rho     (ndarray): Density                        [kg/m^3]\r\n\r\n    nu      (ndarray): Kinematic viscosity            [m^2/s]\r\n\r\n    eta     (ndarray): Dynamic/shear viscosity        [kg/(m s)]\r\n\r\n    alpha   (ndarray): Thermal expansion coefficient  [1/K]\r\n\r\n    kappa   (ndarray): Thermal diffusivity            [m^2/s]\r\n\r\n    lambda_ (ndarray): Thermal conductivity           [W/(m K)]\r\n\r\n    Cp      (ndarray): Isobaric heat capacity         [J/(kg K)]\r\n\r\n    Cv      (ndarray): Isochoric heat capacity        [J/(kg K)]\r\n\r\n    comp    (ndarray): Isothermal compressibility     [1/Pa]\r\n\r\n    Pr      (ndarray): Prandtl number                 [-]\r\n\r\nDennis van Gils, 12-05-2024\r\n\r\nChangelog\r\n=========\r\n\r\n1.1.0 (2024-05-12)\r\n------------------\r\n* Added field `Cv`: Isochoric heat capacity\r\n* Added field `comp`: Isothermal compressibility\r\n\r\n1.0.0 (2024-05-11)\r\n------------------\r\n* Initial release\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Easy access to thermodynamic fluid properties as a function of temperature and pressure. With a minimal command-line interface.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Dennis-van-Gils/python-fluidprop/",
        "Issue Tracker": "https://github.com/Dennis-van-Gils/python-fluidprop/issues"
    },
    "split_keywords": [
        "coolprop",
        " fluids",
        " thermodynamic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "502735626f18f207593be6c3e200a70236843d0c86a9d45381a18533005ddee7",
                "md5": "17d7d68ebc0b350ea469044b2eff0d08",
                "sha256": "488d21b5bd947f7d8930e9d6751d763ca14349b3d777d4038f97e405d616ab80"
            },
            "downloads": -1,
            "filename": "fluidprop-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "17d7d68ebc0b350ea469044b2eff0d08",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9814,
            "upload_time": "2024-05-12T12:16:18",
            "upload_time_iso_8601": "2024-05-12T12:16:18.756050Z",
            "url": "https://files.pythonhosted.org/packages/50/27/35626f18f207593be6c3e200a70236843d0c86a9d45381a18533005ddee7/fluidprop-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "249651c11ea5cf64da473e7fc76cdcc6632b695e63e730f8b054f78ca5add14a",
                "md5": "9d936d4336d34b6929c54a92797e5dfa",
                "sha256": "dae4ad5021b9d5d44add3fe3e71df0240aa8f7209ae8af90f59fde6e1f1ab243"
            },
            "downloads": -1,
            "filename": "fluidprop-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9d936d4336d34b6929c54a92797e5dfa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 9830,
            "upload_time": "2024-05-12T12:16:20",
            "upload_time_iso_8601": "2024-05-12T12:16:20.388196Z",
            "url": "https://files.pythonhosted.org/packages/24/96/51c11ea5cf64da473e7fc76cdcc6632b695e63e730f8b054f78ca5add14a/fluidprop-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-12 12:16:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Dennis-van-Gils",
    "github_project": "python-fluidprop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fluidprop"
}
        
Elapsed time: 0.32452s