Skip to content

Commit 53b08aa

Browse files
committed
v3.7.0
1 parent e31b7c8 commit 53b08aa

File tree

4 files changed

+149
-58
lines changed

4 files changed

+149
-58
lines changed

README.md

Lines changed: 148 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,101 @@
1-
![NeqSim Logo](https://github.com/equinor/neqsim/blob/master/docs/wiki/neqsimlogocircleflatsmall.png)
1+
<h1>
2+
<img src="https://github.com/equinor/neqsim/blob/master/docs/wiki/neqsimlogocircleflatsmall.png" alt="NeqSim Logo" width="120" valign="middle">&nbsp;NeqSim Python
3+
</h1>
24

3-
![Run tests](https://github.com/equinor/neqsim-python/actions/workflows/runtests.yml/badge.svg?branch=master)
4-
![Publish package](https://github.com/equinor/neqsim-python/actions/workflows/publish-to-test-pypi.yml/badge.svg?branch=master)
5+
<p align="center">
6+
<strong>Python interface to the NeqSim engine — fluid properties, process simulation, and PVT analysis from Python and Jupyter notebooks.</strong>
7+
</p>
58

6-
# NeqSim Python
9+
<p align="center">
10+
<a href="https://github.com/equinor/neqsim-python/actions/workflows/runtests.yml?query=branch%3Amaster"><img src="https://github.com/equinor/neqsim-python/actions/workflows/runtests.yml/badge.svg?branch=master" alt="Tests"></a>
11+
<a href="https://github.com/equinor/neqsim-python/actions/workflows/publish-to-test-pypi.yml"><img src="https://github.com/equinor/neqsim-python/actions/workflows/publish-to-test-pypi.yml/badge.svg?branch=master" alt="Publish"></a>
12+
<a href="https://pypi.org/project/neqsim/"><img src="https://img.shields.io/pypi/v/neqsim.svg?label=PyPI" alt="PyPI"></a>
13+
<a href="https://pypi.org/project/neqsim/"><img src="https://img.shields.io/pypi/pyversions/neqsim.svg" alt="Python"></a>
14+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="License"></a>
15+
</p>
716

8-
NeqSim Python is part of the [NeqSim project](https://equinor.github.io/neqsimhome/). NeqSim Python is a Python interface to the [NeqSim Java library](https://github.com/equinor/neqsim) for estimation of fluid behavior and process design for oil and gas production. NeqSim Python toolboxes (eg. [thermoTools](https://github.com/equinor/neqsim-python/blob/master/src/neqsim/thermo/thermoTools.py) and [processTools](https://github.com/equinor/neqsim-python/blob/master/src/neqsim/process/processTools.py)) are implemented to streamline use of neqsim in Python. Examples of use are given in the [examples folder](https://github.com/equinor/neqsim-python/tree/master/examples).
17+
<p align="center">
18+
<a href="#-quick-start">Quick Start</a> ·
19+
<a href="#-process-simulation">Process Simulation</a> ·
20+
<a href="#-pvt-simulation">PVT Simulation</a> ·
21+
<a href="#-examples">Examples</a> ·
22+
<a href="https://equinor.github.io/neqsimhome/">Docs</a> ·
23+
<a href="https://github.com/equinor/neqsim/discussions">Community</a>
24+
</p>
925

10-
## Installation
26+
---
1127

12-
NeqSim Python can be installed via **pip** or **conda**.
28+
## What is NeqSim Python?
1329

14-
### Using pip
30+
NeqSim Python is part of the [NeqSim project](https://equinor.github.io/neqsimhome/) — a Python interface to the [NeqSim Java library](https://github.com/equinor/neqsim) for estimation of fluid behavior and process design for oil and gas production.
1531

16-
```bash
17-
pip install neqsim
18-
```
32+
It provides Python toolboxes such as [thermoTools](https://github.com/equinor/neqsim-python/blob/master/src/neqsim/thermo/thermoTools.py) and [processTools](https://github.com/equinor/neqsim-python/blob/master/src/neqsim/process/processTools.py) that streamline the use of NeqSim, plus direct access to the full Java API via the `jneqsim` gateway.
33+
34+
| Capability | What you get |
35+
|------------|-------------|
36+
| **Thermodynamics** | 60+ EOS models (SRK, PR, CPA, GERG-2008, …), flash calculations, phase envelopes |
37+
| **Physical properties** | Density, viscosity, thermal conductivity, surface tension |
38+
| **Process simulation** | 33+ equipment types — separators, compressors, heat exchangers, valves, pumps, reactors |
39+
| **PVT simulation** | CME, CVD, differential liberation, separator tests, swelling, viscosity |
40+
| **Pipeline & flow** | Steady-state multiphase pipe flow (Beggs & Brill), pipe networks |
1941

20-
### Using Conda
42+
---
2143

22-
NeqSim is available on conda-forge. Install with:
44+
## 🚀 Quick Start
45+
46+
### Install
47+
48+
<table>
49+
<tr><td><strong>pip</strong> (requires Java 11+)</td><td><strong>conda</strong> (Java included)</td></tr>
50+
<tr>
51+
<td>
2352

2453
```bash
25-
conda install -c conda-forge neqsim
54+
pip install neqsim
2655
```
2756

28-
Or add conda-forge to your channels and install:
57+
</td>
58+
<td>
2959

3060
```bash
31-
conda config --add channels conda-forge
32-
conda config --set channel_priority strict
33-
conda install neqsim
61+
conda install -c conda-forge neqsim
3462
```
3563

36-
**Note:** The conda package automatically includes Java (OpenJDK) as a dependency, so no separate Java installation is required.
64+
</td>
65+
</tr>
66+
</table>
3767

38-
### Prerequisites
68+
> **Prerequisites:** Python 3.9+ and Java 11+. The conda package automatically installs OpenJDK — no separate Java setup needed. For pip, install Java from [Adoptium](https://adoptium.net/).
3969
40-
- Python 3.9 or higher
41-
- Java 11 or higher (automatically installed with conda, or install separately for pip)
70+
### Try it now
4271

43-
## Getting Started
72+
```python
73+
from neqsim.thermo import fluid
4474

45-
See the [NeqSim Python Wiki](https://github.com/equinor/neqsim-python/wiki) for how to use NeqSim Python via Python or in Jupyter notebooks. Also see [examples of use of NeqSim for Gas Processing in Colab](https://colab.research.google.com/github/EvenSol/NeqSim-Colab/blob/master/notebooks/examples_of_NeqSim_in_Colab.ipynb#scrollTo=kHt6u-utpvYf). Learn and ask questions in [Discussions for use and development of NeqSim](https://github.com/equinor/neqsim/discussions).
75+
# Create a natural gas fluid
76+
fl = fluid('srk')
77+
fl.addComponent('methane', 0.85)
78+
fl.addComponent('ethane', 0.10)
79+
fl.addComponent('propane', 0.05)
80+
fl.setTemperature(25.0, 'C')
81+
fl.setPressure(60.0, 'bara')
82+
fl.setMixingRule('classic')
83+
84+
from neqsim.thermo import TPflash, printFrame
85+
TPflash(fl)
86+
printFrame(fl)
87+
```
88+
89+
---
4690

47-
## Process Simulation
91+
## 🔧 Process Simulation
4892

4993
NeqSim Python provides multiple ways to build process simulations:
5094

51-
### 1. Python Wrappers (Recommended for beginners)
95+
<details>
96+
<summary><strong>1. Python Wrappers</strong> — recommended for beginners & notebooks</summary>
5297

53-
Simple functions with a global process - great for notebooks and prototyping:
98+
Simple functions with a global process great for prototyping:
5499

55100
```python
56101
from neqsim.thermo import fluid
@@ -72,9 +117,12 @@ runProcess()
72117
print(f"Compressor power: {comp.getPower()/1e6:.2f} MW")
73118
```
74119

75-
### 2. ProcessContext (Recommended for production)
120+
</details>
121+
122+
<details>
123+
<summary><strong>2. ProcessContext</strong> — recommended for production code</summary>
76124

77-
Context manager with explicit process control - supports multiple independent processes:
125+
Context manager with explicit process control supports multiple independent processes:
78126

79127
```python
80128
from neqsim.thermo import fluid
@@ -94,9 +142,12 @@ with ProcessContext("Compression Train") as ctx:
94142
print(f"Compressor power: {comp.getPower()/1e6:.2f} MW")
95143
```
96144

97-
### 3. ProcessBuilder (Fluent API)
145+
</details>
98146

99-
Chainable builder pattern - ideal for configuration-driven design:
147+
<details>
148+
<summary><strong>3. ProcessBuilder</strong> — fluent API for configuration-driven design</summary>
149+
150+
Chainable builder pattern:
100151

101152
```python
102153
from neqsim.thermo import fluid
@@ -117,9 +168,12 @@ process = (ProcessBuilder("Compression Train")
117168
print(f"Compressor power: {process.get('compressor').getPower()/1e6:.2f} MW")
118169
```
119170

120-
### 4. Direct Java Access (Full control)
171+
</details>
172+
173+
<details>
174+
<summary><strong>4. Direct Java Access</strong> — full control via jneqsim</summary>
121175

122-
Explicit process management using jneqsim - for advanced features see [neqsim java API](https://github.com/equinor/neqsim):
176+
Explicit process management using the Java API — for advanced features see the [NeqSim Java repo](https://github.com/equinor/neqsim):
123177

124178
```python
125179
from neqsim import jneqsim
@@ -147,46 +201,83 @@ process.run()
147201
print(f"Compressor power: {comp.getPower()/1e6:.2f} MW")
148202
```
149203

204+
</details>
205+
150206
### Choosing an Approach
151207

152-
| Use Case | Recommended Approach |
153-
| --------------------------- | -------------------- |
154-
| Learning & prototyping | Python wrappers |
155-
| Jupyter notebooks | Python wrappers |
156-
| Production applications | ProcessContext |
157-
| Multiple parallel processes | ProcessContext |
158-
| Configuration-driven design | ProcessBuilder |
159-
| Advanced Java features | Direct Java access |
208+
| Use Case | Recommended Approach |
209+
|----------|---------------------|
210+
| Learning & prototyping | Python wrappers |
211+
| Jupyter notebooks | Python wrappers |
212+
| Production applications | ProcessContext |
213+
| Multiple parallel processes | ProcessContext |
214+
| Configuration-driven design | ProcessBuilder |
215+
| Advanced Java features | Direct Java access |
216+
217+
---
218+
219+
## 🧪 PVT Simulation
220+
221+
NeqSim includes a `pvtsimulation` package for common PVT experiments (CCE/CME, CVD, differential liberation, separator tests, swelling, viscosity, etc.) and tuning workflows.
222+
223+
- [PVT simulation documentation](docs/pvt_simulation.md)
224+
- [PVT examples with direct Java access](examples/pvtsimulation/README.md)
160225

161-
See the [examples folder](https://github.com/equinor/neqsim-python/tree/master/examples) for more process simulation examples, including [processApproaches.py](https://github.com/equinor/neqsim-python/blob/master/examples/processApproaches.py) which demonstrates all four approaches.
226+
---
162227

163-
## PVT Simulation (PVTsimulation)
228+
## 📂 Examples
164229

165-
NeqSim also includes a `pvtsimulation` package for common PVT experiments (CCE/CME, CVD, differential liberation, separator tests, swelling, viscosity, etc.) and tuning workflows.
230+
Explore ready-to-run examples in the [examples folder](https://github.com/equinor/neqsim-python/tree/master/examples):
166231

167-
- Documentation: `docs/pvt_simulation.md`
168-
- Direct Java access examples: `examples/pvtsimulation/README.md`
232+
- Process simulation — [processApproaches.py](https://github.com/equinor/neqsim-python/blob/master/examples/processApproaches.py) (all four approaches)
233+
- Flash calculations, phase envelopes, hydrate prediction
234+
- Compressor trains, heat exchangers, separation processes
235+
- Jupyter notebooks in [examples/jupyter/](https://github.com/equinor/neqsim-python/tree/master/examples/jupyter)
236+
- [Google Colab examples](https://colab.research.google.com/github/EvenSol/NeqSim-Colab/blob/master/notebooks/examples_of_NeqSim_in_Colab.ipynb)
169237

170-
## Prerequisites
238+
---
171239

172-
Java version 8 or higher ([Java JDK](https://adoptium.net/)) needs to be installed. The Python package [JPype](https://github.com/jpype-project/jpype) is used to connect Python and Java. Read the [installation requirements for Jpype](https://jpype.readthedocs.io/en/latest/install.html). Be aware that mixing 64 bit Python with 32 bit Java and vice versa crashes on import of the jpype module. The needed Python packages are listed in the [NeqSim Python dependencies page](https://github.com/equinor/neqsim-python/network/dependencies).
240+
## ⚙️ Technical Notes
173241

174-
## Contributing
242+
[JPype](https://github.com/jpype-project/jpype) bridges Python and Java. See the [JPype installation guide](https://jpype.readthedocs.io/en/latest/install.html) for platform-specific details. Ensure Python and Java are both 64-bit (or both 32-bit) — mixing architectures will crash on import.
175243

176-
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.
244+
The full list of Python dependencies is on the [dependencies page](https://github.com/equinor/neqsim-python/network/dependencies).
177245

178-
## Discussion forum
246+
---
179247

180-
Questions related to neqsim can be posted in the [github discussion pages](https://github.com/equinor/neqsim/discussions).
248+
## 🏗️ Contributing
249+
250+
We welcome contributions — bug fixes, new examples, documentation improvements, and more.
251+
252+
- [CONTRIBUTING.md](CONTRIBUTING.md) — Code of conduct and PR process
253+
- [NeqSim Python Wiki](https://github.com/equinor/neqsim-python/wiki) — Guides and usage patterns
254+
255+
---
256+
257+
## 📚 Documentation & Resources
258+
259+
| Resource | Link |
260+
|----------|------|
261+
| **NeqSim homepage** | [equinor.github.io/neqsimhome](https://equinor.github.io/neqsimhome/) |
262+
| **Python wiki** | [neqsim-python/wiki](https://github.com/equinor/neqsim-python/wiki) |
263+
| **JavaDoc API** | [JavaDoc](https://equinor.github.io/neqsimhome/javadoc/site/apidocs/index.html) |
264+
| **Discussion forum** | [GitHub Discussions](https://github.com/equinor/neqsim/discussions) |
265+
| **NeqSim Java** | [equinor/neqsim](https://github.com/equinor/neqsim) |
266+
| **MATLAB binding** | [equinor/neqsimmatlab](https://github.com/equinor/neqsimmatlab) |
267+
| **Releases** | [GitHub Releases](https://github.com/equinor/neqsim-python/releases) |
268+
269+
---
181270

182271
## Versioning
183272

184-
NeqSim use [SemVer](https://semver.org/) for versioning.
273+
NeqSim uses [SemVer](https://semver.org/) for versioning.
274+
275+
## Authors
185276

186-
## Licence
277+
Even Solbraa (esolbraa@gmail.com), Marlene Louise Lund
187278

188-
NeqSim is distributed under the [Apache-2.0](https://github.com/equinor/neqsimsource/blob/master/LICENSE) licence.
279+
NeqSim development was initiated at [NTNU](https://www.ntnu.edu/employees/even.solbraa). A number of master and PhD students have contributed — we greatly acknowledge their contributions.
189280

190-
## Acknowledgments
281+
## License
191282

192-
A number of master and PhD students at NTNU have contributed to development of NeqSim. We greatly acknowledge their contributions.
283+
[Apache-2.0](LICENSE)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "neqsim"
3-
version = "3.6.1"
3+
version = "3.7.0"
44
homepage = "https://github.com/Equinor/neqsim-python"
55
description = "NeqSim is a tool for thermodynamic and process calculations"
66
authors = ["Even Solbraa <esolbraa@gmail.com>"]
42.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)