Metadata-Version: 2.1
Name: WaterOptim
Version: 1.6.2
Summary: Water-Pinch tool
Home-page: https://wateroptim.readthedocs.io/en/latest/
Author: Hedi ROMDHANA
Author-email: hedi.romdhana@agroparistech.fr
License: GPLv3
Keywords: water pinch process integration
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Testing
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Requires-Python: >=3.4
Description-Content-Type: text/markdown
Requires-Dist: prettytable
Requires-Dist: graphviz
Requires-Dist: wxPython
Requires-Dist: pymoo
Requires-Dist: uuid
Requires-Dist: cryptography
Requires-Dist: SALib
Requires-Dist: python-docx



***
# **Water Pinch Analysis**

**A powerful pure-Python interface for optimizing industrial water networks**

***

[**Read the docs**](https://wateroptim.readthedocs.io/en/latest/)


# Installation

**`WaterOptim`**  runs under Python 3.6+. To install it with [pip](https://pip.readthedocs.io/), run the following:

    pip install WaterOptim
  To upgrade it with [pip](https://pip.readthedocs.io/), run the following:

    pip install --upgrade WaterOptim

# Basic usage
**`WaterOptim`** proposes water networks with optimized water recovery schemes to preserve freshwater and minimize wastewater production. The tool supports water networks with one or more pollutants.
The optimization strategy includes 3 steps:

1. Inventory
2. Minimization of Freshwater and Wastewater
3. Design of Water-network

The inventory can be carried out on:
 - ***Water-using process*** involving pollution transfer. The pollution comes from the product or the process.
The inventory includes:

|                |Parameter                          |Unit                         |
|----------------|-------------------------------|-----------------------------|
|**`mc`**|`Mass flowrate of contaminant`            |**`kg/h`**            |
|**`Cin_max`**          |`Maximum inlet concentration`            |**`ppm`**           |
|**`Cout_max `**         |`Maximum outlet concentration`|**`ppm `**|
#### Example of **`Water-using process`** inventory:


```py
posts = [
          {"name":"process 1","cin_max":0,"cout_max":100,"mc":2},
          {"name":"process 2","cin_max":50,"cout_max":100,"mc":5},
          {"name":"process 3","cin_max":50,"cout_max":800,"mc":30},
          {"name":"process 4","cin_max":400,"cout_max":800,"mc":4}
        ]
```



 - ***Source*** water flow, available for the `REUSE`.
 The inventory includes:

|                |Parameter                          |Unit                         |
|----------------|-------------------------------|-----------------------------|
|**`m`**|`Volume flowrate of water`            |**`m3/h`**            |
|**`c `**         |`Outlet concentration`|**`ppm`** |
#### Example of **`Sources`** inventory:


```py
sources = [
            {'name':'Distillation bottoms','c':0,'m':.8*3600/1000},
            {'name':'Off-gas condensate','c':14,'m':5*3600/1000},
            {'name':'Aqueous layer','c':25,'m':5.9*3600/1000},
            {'name':'Ejector condensate','c':34,'m':1.4*3600/1000}]
```
 - ***Sink*** water requirement.
 The inventory includes:

|                |Parameter                          |Unit                         |
|----------------|-------------------------------|-----------------------------|
|**`m`**|`Volume flowrate of water`            |m**`3/h`**            |
|**`cin_max`**          |`Maximum inlet concentration`|**`ppm`** |

#### Example of **`Sinks`** inventory:


```py
demands = [
            {'name':'BFW0','cin_max':0,'m':1.2*3600/1000},
            {'name':'BFW','cin_max':10,'m':5.8*3600/1000},
            {'name':'BFW1','cin_max':1,'m':19.8*3600/1000}]
```
### Basic compilation
Import this module with the following command:
```py
import WaterOptim.wpinch as wp
```
Compilation of _`water-using processes`_
```py
r= wp.__pinch__(posts=posts,verbose=True,design=True)  
```
Using the **_`cascade`_** attribute you can access the optimization details:

```py
+---------+------------+-------------------+----------+----------+-----------+--------+--------+
|  C ppm  |   Purity   | Purity Difference |   NWSD   |   CWSD   |    PWF    |  CPWF  |  FFW   |
+---------+------------+-------------------+----------+----------+-----------+--------+--------+
|    -    |     -      |         -         |    -     | fw=90.00 |           |        |        |
|    0    |  1.000000  |                   |  -20.00  |          |           |        |        |
|         |            |      0.000050     |          |  70.00   |  0.003500 |        |        |
|    50   |  0.999950  |                   | -140.00  |          |           |  0.00  | 70.00  |
|         |            |      0.000050     |          |  -70.00  | -0.003500 |        |        |
|  {100}  | {0.999900} |         {}        | {120.00} |    {}    |     {}    | {0.00} | {0.00} |
|         |            |      0.000300     |          |  50.00   |  0.015000 |        |        |
|   400   |  0.999600  |                   |  -10.00  |          |           |  0.01  | 37.50  |
|         |            |      0.000400     |          |  40.00   |  0.016000 |        |        |
|   800   |  0.999200  |                   |  50.00   |          |           |  0.03  | 38.75  |
|         |            |      0.999200     |          |  90.00   | 89.928000 |        |        |
| 1000000 |  0.000000  |                   |   0.00   |          |           | 89.96  | 89.96  |
|    -    |     -      |         -         |    -     | ww=90.00 |           |        |        |
+---------+------------+-------------------+----------+----------+-----------+--------+--------+
```



### Dependencies

 - [scipy](https://www.scipy.org/)
 - [numpy](https://numpy.org/)
 - [matplotlib](https://matplotlib.org/)
 - [graphviz](https://graphviz.org/)






# Acknowledgments
The authors wish to thank the French National Research Agency [ANR](https://anr.fr/Projet-ANR-17-CE10-0015) for their funding, and the partners of the project [MINIMEAU](https://minimeau.fr/) led by **AgroParisTech** (French higher education and public research institute), in collaboration with **ProSim** (Expert in process simulation) **ACTALIA**, **CRITT**, **CTCPA**, **IFV**, **ITERG** (Centers of expertise for the food industry), and **INRAE ELSA** (French institute for agriculture, food and environment)

