8000 GitHub - chenhan12306/two-phase: A simple and easy-to-use two-phase flow library.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chenhan12306/two-phase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
rho_g = tp.rho_g[0]  # Gas specific mass
mu_g = tp.mu_g[0]  # Gas viscosity

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0