Skip to main content

A library containing various tools in the categories of thermodynamics, fluid mechanics, metering etc.

Project description

pvtlib logo

pvtlib is a Python library that provides various tools in the categories of thermodynamics, fluid mechanics, metering and various process equipment. The library includes functions for calculating flow rates, gas properties, and other related calculations.

Installation

You can install the library using pip:

pip install pvtlib

NOTE: The library currently do not support numpy >= 2

Usage

Here is an example of how to use the library:

from pvtlib.metering import differential_pressure_flowmeters

# Example usage of the calculate_flow_venturi function
result = differential_pressure_flowmeters.calculate_flow_venturi(D=0.1, d=0.05, dP=200, rho1=1000)
print(result)

More examples are provided in the examples folder: https://github.com/equinor/pvtlib/tree/main/examples

Features

  • Thermodynamics: Thermodynamic functions
  • Fluid Mechanics: Fluid mechanic functions
  • Metering: Metering functions
  • aga8: Equations for calculating gas properties (GERG-2008 and DETAIL) using the Rust port (https://crates.io/crates/aga8) of NIST's AGA8 code (https://github.com/usnistgov/AGA8)
  • Unit converters: Functions to convert between different units of measure

Handling of invalid input

This library is used for analyzing large amounts of data, as well as in live applications. In these applications it is desired that the functions return "nan" (using numpy nan) when invalid input are provided, or in case of certain errors (such as "divide by zero" errors).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any questions or suggestions, feel free to open an issue or contact the author at chaagen2013@gmail.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pvtlib-1.8.2.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pvtlib-1.8.2-py3-none-any.whl (66.5 kB view details)

Uploaded Python 3

File details

Details for the file pvtlib-1.8.2.tar.gz.

File metadata

  • Download URL: pvtlib-1.8.2.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for pvtlib-1.8.2.tar.gz
Algorithm Hash digest
SHA256 0986b08d8f8df994c009c4424e60bc44b886111cfd4266d5d6bb9966b0cc5838
MD5 f6c81e5ce2cdfe1311f8c4c7914b9f51
BLAKE2b-256 fd0aad5d08250c6ad55f58387fd98afa204c5f59a0ec5b50905217e8b0a8e076

See more details on using hashes here.

File details

Details for the file pvtlib-1.8.2-py3-none-any.whl.

File metadata

  • Download URL: pvtlib-1.8.2-py3-none-any.whl
  • Upload date:
  • Size: 66.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for pvtlib-1.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f810f5d26bc292637be7f50a844ed67cc6d2f069fc0f7f5cb30ab6974b6f8253
MD5 49d33b27a22c118ea34714f344336f76
BLAKE2b-256 e5949a6fe9dcdf4acb3b603acd16d1c28319a17ff1c58082f792b48364bf7322

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page