Skip to main content

A simple and easy-to-use two-phase flow library.

Project description

Two-phase flow

The two-phase flow is a Python library that implements two-phase flows models and make easy to get the flow properties such as flow pattern, elongated bubble velocity, homogenous model properties etc. This library is structured in a way that the user can program using a simple and easy-to-use objects or in a more advanced manner can use the functions of the library directly.

The fluid properties are by default automatically obtained from the CoolProp. However, you can also pass your own functions, determined experimentally or from any source you want.

The library has also some basic plot utils for some flow pattern maps.

Installation

Use the package manager pip to install two-phase flow package.

pip install two-phase

Usage

from two_phase import TwoPhase
import pandas as pd

# Load your experimental data
df = pd.read_excel("table_exp_points.xlsx")

# Configure your experimental setup in SI units
tp = TwoPhase(d=0.0525, l=8.1, theta=90, gas="air", liquid="water")

# Set the liquid and gas superficial velocities
tp.v_sl = df["V_sl (m/s)"].values
tp.v_sg = df["V_sg (m/s)"].values

# Set the pressure and temperature
tp.P = df["PT-101 (kPa)"].values * 1e3 + 101.325 * 1e3
tp.T = df["TT-101 (C)"].values

# Get flow Pattern of each experimental point
ptt = tp.ptt.taitel1980(text=True)

# Get the elongated bubble velocity for each experimental point
v_tb = tp.eb_vel.ebmodels()
v_tb_nicklin = tp.eb_vel.nicklin1962()

# Get volumetric flow-rate
q_l = tp.Q_l
q_g = tp.Q_g

# Get experimental properties
P_0 = tp.P[0]  # Pressure
T_0 = tp.T[0]  # Temperature
q_g0 = tp.Q_g[0]  # Gas flow rate
v_sg0 = tp.v_sg[0]  # Gas superficial velocity

Roadmap

  • CoolProp integration
  • Homogeneous model
  • Elongated bubble models
  • Taitel 1980 - flow pattern map for vertical flows (being developed)
  • Flow pattern map for horizontal flows
  • Lockhart Martinelli model
  • Alves Anular Flow model
  • Taitel and Barnea model
  • Drift model
  • Beggs and Brill model
  • Hagedorn Brown model
  • Black oil model

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change or add.

When contributing, please use the black code formatter as it formats the code to looks the same regardless of the project you are reading.

Please make sure to update tests as appropriate.

Credits

@felipecastrotc

License

GPLv3

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

two-phase-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

File details

Details for the file two-phase-0.1.0.tar.gz.

File metadata

  • Download URL: two-phase-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.0.post20200616 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for two-phase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7a42ba3432ac99e138b05b8a12cc3c3f563aa6d070836e55b6a43549fee611be
MD5 78a357a3b1541bdfd19d4beaa64cd8e6
BLAKE2b-256 b4fe4bcf4ce518cf51511598ea3e047002456518378387955c433d15eccbaaed

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