Giter Club home page Giter Club logo

phreeqpython's Introduction

Phreeqpython Logo

PhreeqPython is an object oriented wrapper around the (VIPhreeqc) extension of the Phreeqc chemical calculation engine (Parkhurst&Appello), written in Python.

Features

PhreeqPython greatly simplifies adding solutions and querying their properties:

pp = PhreeqPython()
# add a solution consisting of 1 mmol CaCl2 and 2 mmol NaHCO3
solution = pp.add_solution({'CaCl2':1.0,'NaHCO3':2.0})
print(solution.pH)               # 8.12
print(solution.sc)               # 427.32
print(solution.si('Calcite'))    # 0.38
print(solution.species['HCO3-']) # 0.0019
print(solution.elements['Cl'])   # 0.002 mol

Allows for simple chemical and precipitation/dissolution reactions:

solution.add('NaOH',0.5)
print(solution.pH)              # 9.47
solution.desaturate('Calcite')  # desaturate to SI 0
print(solution.total('Ca'))     # 1 mmol

And even allows for addition, devision and multiplication of solutions to form new mixtures:

solution2 = pp.add_solution({'KCl':1.0})
# create mixture of 50% solution and 50% solution2
solution3 = solution * 0.5 + solution2 * 0.5
print(solution3.total('K','mol'))     # 0.0005 mol

For more examples, take a look at the examples folder.

Installation

  • pip install -U phreeqpython

Requirements

Unit Tests

Mac/Linux Windows Coverage
Build Status Build status codecov

Acknowledgements

This project makes use of the (Phreeqc) (David Parkhurst & Tony Apello) calcution engine and is (partly) derived from the (PhreeqPy) extension for IPhreeqc (Mike Müller)

About Vitens

Vitens is the largest drinking water company in The Netherlands. We deliver top quality drinking water to 5.6 million people and companies in the provinces Flevoland, Fryslân, Gelderland, Utrecht and Overijssel and some municipalities in Drenthe and Noord-Holland. Annually we deliver 350 million m³ water with 1,400 employees, 100 water treatment works and 49,000 kilometres of water mains.

One of our main focus points is using advanced water quality, quantity and hydraulics models to further improve and optimize our treatment and distribution processes.

Licence

Copyright 2021 Vitens

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

phreeqpython's People

Contributors

abelheinsbroek avatar jeroen1405 avatar martinwk avatar

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.