Giter Club home page Giter Club logo

pysand's Introduction

pypi tests python SCM Compliance

PySand is a python package with sand management related calculations for oil and gas industry developed by Equinor.

  • Acoustic sand detectors standard calibration and quantification
  • Basic (black oil) fluid properties
  • DNV RP-O501 erosion rate calculations
  • ER probe sand quantification
  • Sand transport models

Installation instructions

pip install pysand
Upgrade
pip install pysand --upgrade
Removal
pip uninstall pysand

Usage

Jupyter Notebooks with example usage can be found in the example directory:

Bringing them all together:

Contributing

If you want to contribute to the project and make it better, your help is very welcome. Follow the following instructions and read the CONTRIBUTING.md file before getting started.

pysand's People

Contributors

cklov avatar felixantonio avatar knudsvik avatar poyiostona avatar smolvik1 avatar vermee81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pysand's Issues

Add name to material properties dictionary

To ease integration with pysand-web, adding a display name to the material properties dictionary would be of great help (pysand.erosion.material_properties):

{ 'carbon_steel': {'rho_t': 7800, 'K': 2e-9, 'n': 2.6, 'angle_dependency': 'ductile', 'name': 'Carbon Steel'}, 'duplex': {'rho_t': 7850, 'K': 2e-9, 'n': 2.6, 'angle_dependency': 'ductile', 'name': 'Duplex'}, 'ss316': {'rho_t': 8000, 'K': 2e-9, 'n': 2.6, 'angle_dependency': 'ductile', 'name': 'SS316'}, 'inconel': {'rho_t': 8440, 'K': 2e-9, 'n': 2.6, 'angle_dependency': 'ductile', 'name': 'Inconel'}, 'grp_epoxy': {'rho_t': 1800, 'K': 3e-10, 'n': 3.6, 'angle_dependency': 'ductile', 'name': 'GRP Epoxy'}, 'grp_vinyl_ester': {'rho_t': 1800, 'K': 6e-10, 'n': 3.6, 'angle_dependency': 'ductile', 'name': 'GRP Vinyl Ester'}, 'hdpe': {'rho_t': 1150, 'K': 3.5e-9, 'n': 2.9, 'angle_dependency': 'ductile', 'name': 'HDPE'}, 'aluminium': {'rho_t': 2700, 'K': 5.8e-9, 'n': 2.3, 'angle_dependency': 'ductile', 'name': 'Aluminium'}, 'dc_05_tungsten': {'rho_t': 15250, 'K': 1.1e-10, 'n': 2.3, 'angle_dependency': 'brittle', 'name': 'DC 05 Tungsten'}, 'cs_10_tungsten': {'rho_t': 14800, 'K': 3.2e-10, 'n': 2.2, 'angle_dependency': 'brittle', 'name': 'CS 10 Tungsten'}, 'cr_37_tungsten': {'rho_t': 14600, 'K': 8.8e-11, 'n': 2.5, 'angle_dependency': 'brittle', 'name': 'CR 37 Tungsten'}, '95_alu_oxide': {'rho_t': 3700, 'K': 6.8e-8, 'n': 2, 'angle_dependency': 'brittle', 'name': '95 Alu Oxide'}, '99_alu_oxide': {'rho_t': 3700, 'K': 9.5e-7, 'n': 1.2, 'angle_dependency': 'brittle', 'name': '99 Alu Oxide'}, 'psz_ceramic_zirconia': {'rho_t': 5700, 'K': 4.1e-9, 'n': 2.5, 'angle_dependency': 'brittle', 'name': 'PSZ Ceramic Zirconia'}, 'ZrO2-Y3_ceramic_zirconia': {'rho_t': 6070, 'K': 4e-11, 'n': 2.7, 'angle_dependency': 'brittle', 'name': 'Zr02-Y3 Ceramic Zirconia'}, 'SiC_silicon_carbide': {'rho_t': 3100, 'K': 6.5e-9, 'n': 1.9, 'angle_dependency': 'brittle', 'name': 'Silicon Carbide'}, 'Si3N4_silicon_nitride': {'rho_t': 3200, 'K': 2e-10, 'n': 2, 'angle_dependency': 'brittle', 'name': 'Silicon Nitride'}, 'TiB2_titanium_diboride': {'rho_t': 4250, 'K': 9.3e-9, 'n': 1.9, 'angle_dependency': 'brittle', 'name': 'Titanium Diboride'}, 'B4C_boron_carbide': {'rho_t': 2500, 'K': 3e-8, 'n': .9, 'angle_dependency': 'brittle', 'name': 'Boron Carbide'}, 'SiSiC_ceramic_carbide': {'rho_t': 3100, 'K': 7.4e-11, 'n': 2.7, 'angle_dependency': 'brittle', 'name': 'Ceramic Carbide'} }

Continuous Deployment

Add CD functionality for automatic versioning and pushing to PyPi when merging PR's.

Change Hydro Transport description

The description of Hydro transport model currently reads:
Equinor sand transport model for horizontal pipelines Based on T. Søntvedt (1995) and R. Schulkes (2002) work in Hydro

This is not 100% correct, as the model appear to have been influenced by other test-data, and is not able to re-produce 1:1 lab measurements from the mentioned Schulkes report. New description should reflect this

Remove geometry factor warning

At the moment there is a logger warning when geometry factors above 4 in erosion.py. In reality one could use higher GF for components to adjust for special cases like jets.

Add liquid properties

Liquid density and liquid viscosity is used for horisontal sand transport models. Should be included in the fluid properties module.

droplet erosion

  • Warning on high velocities (> 70 m/s)
  • Droplet erosion model (base-asdn g73 10)

Crushed proppants

Add functionality for crushed proppants in erosion functions, e.g

crushed=false as input. if crushed=True: return 3xE

pysand.asd - None eller NaN dersom input til validate_asd er negativ?

Dersom en av input-verdiene til validate_asd er negativ vil asd_step_emerson og asd_step_clampon returnere "None". I logger.warning-teksten til validate_asd står det at nan vil bli returnert. Foreslår at asd_step_emerson og asd_step_clampon endres til å returnere np.nan is stedet for None dersom validate_asd returnerer True

Add particle density and material functions

rho_p and material functions missing, need to check RP:

  • straight pipe?

rho_p not part of model, need to check RP:

  • welded joint, reducer, probes

rho_p missing in models using bend model, should be added to:

  • choke gallery, manifold, flexible

Should pysand allow nan as input and return nan?

After implementing pysand in IOC erosion calculations we have encountered several issues with NaN values. IOC accept NaNs as a valid result, however pysand throws an exception if a NaN value is passed as input. The result is that the IOC calculations fail and cannot progress past the timestamp containing a NaN and data starts to lag.

We have made some modifications to the pythonscripts in IOC to replace NaN values before they are passed to pysand, but maybe pysand should accept NaNs as this is a valid datapoint in python?

Negative input should throw np.nan

Inputs like v_m, rho_m, mu_m, Q_s..
Maybe the simplest thing would be to say
if E < 0: return np.nan for all erosion models? This way, any negative input will throw np.nan...

ER probe quantification input validation

  • v_m should be above 5 m/s as per DNVGL RP-O501
  • validate E_meas. Should be positive and float or pd.series etc...

ER probe included from version 1.2 (er-probe branch)

update usage notebooks

  • include ps.__version__ etc to indicate what version was used in the examples
  • include example with using dataframes (time series for erosion calcs). May be imported as a csv.
  • erosion from mm/year to mm/ton

Allow for numpy array element input?

Example:
v_m = np.arange(5,50,10) # Mix velocity [m/s]
D = 0.2

for hastighet in v_m:
st_pipe = pysand.erosion.straight_pipe(hastighet, D)

raises exception that 'v_m is not a number' (v_m = hastighet)

Erosion input validation fixes

  • D boundaries in RP-O501 (0.01 - 1 m) should be stated in the warning
  • d_p boundaries in RP-O501 (0.02 - 5 mm) should be stated in the warning
  • When D and d_p are negative, they should not give result
  • alpha in probes should be limited to 10-90 deg (page 34 in RP-O501)

Following parameters gave no error:

  • v_m to be positive (limitations exist in RP-O501: 0-200)
  • rho_m to be positive (limitations exist in RP-O501: 1-1500)
  • mu_m to be positive (limitations exist in RP-O501: 1e-6-1e-2)
  • Q_s to be positive (limitations exist in RP-O501: 0-500 ppmV)
  • R to be positive (limitations exist in RP-O501: 0.5-50)

All above checked for bend model in version 1.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.