
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
neqsim
Advanced tools

NeqSim Python is part of the NeqSim project. NeqSim Python is a Python interface to the NeqSim Java library for estimation of fluid behavior and process design for oil and gas production. NeqSim Python toolboxes (eg. thermoTools and processTools) are implemented to streamline use of neqsim in Python. Examples of use are given in the examples folder.
NeqSim Python can be installed via pip or conda.
pip install neqsim
NeqSim is available on conda-forge. Install with:
conda install -c conda-forge neqsim
Or add conda-forge to your channels and install:
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install neqsim
Note: The conda package automatically includes Java (OpenJDK) as a dependency, so no separate Java installation is required.
See the 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. Learn and ask questions in Discussions for use and development of NeqSim.
NeqSim Python provides multiple ways to build process simulations:
Simple functions with a global process - great for notebooks and prototyping:
from neqsim.thermo import fluid
from neqsim.process import stream, compressor, separator, runProcess, clearProcess
clearProcess()
feed = fluid('srk')
feed.addComponent('methane', 0.9)
feed.addComponent('ethane', 0.1)
feed.setTemperature(30.0, 'C')
feed.setPressure(50.0, 'bara')
feed.setTotalFlowRate(10.0, 'MSm3/day')
inlet = stream('inlet', feed)
sep = separator('separator', inlet)
comp = compressor('compressor', sep.getGasOutStream(), pres=100.0)
runProcess()
print(f"Compressor power: {comp.getPower()/1e6:.2f} MW")
Context manager with explicit process control - supports multiple independent processes:
from neqsim.thermo import fluid
from neqsim.process import ProcessContext
feed = fluid('srk')
feed.addComponent('methane', 0.9)
feed.addComponent('ethane', 0.1)
feed.setTemperature(30.0, 'C')
feed.setPressure(50.0, 'bara')
with ProcessContext("Compression Train") as ctx:
inlet = ctx.stream('inlet', feed)
sep = ctx.separator('separator', inlet)
comp = ctx.compressor('compressor', sep.getGasOutStream(), pres=100.0)
ctx.run()
print(f"Compressor power: {comp.getPower()/1e6:.2f} MW")
Chainable builder pattern - ideal for configuration-driven design:
from neqsim.thermo import fluid
from neqsim.process import ProcessBuilder
feed = fluid('srk')
feed.addComponent('methane', 0.9)
feed.addComponent('ethane', 0.1)
feed.setTemperature(30.0, 'C')
feed.setPressure(50.0, 'bara')
process = (ProcessBuilder("Compression Train")
.add_stream('inlet', feed)
.add_separator('separator', 'inlet')
.add_compressor('compressor', 'separator', pressure=100.0)
.run())
print(f"Compressor power: {process.get('compressor').getPower()/1e6:.2f} MW")
Explicit process management using jneqsim - for advanced features see neqsim java API:
from neqsim import jneqsim
from neqsim.thermo import fluid
feed = fluid('srk')
feed.addComponent('methane', 0.9)
feed.addComponent('ethane', 0.1)
feed.setTemperature(30.0, 'C')
feed.setPressure(50.0, 'bara')
# Create equipment using Java classes
inlet = jneqsim.process.equipment.stream.Stream('inlet', feed)
sep = jneqsim.process.equipment.separator.Separator('separator', inlet)
comp = jneqsim.process.equipment.compressor.Compressor('compressor', sep.getGasOutStream())
comp.setOutletPressure(100.0)
# Create and run process explicitly
process = jneqsim.process.processmodel.ProcessSystem()
process.add(inlet)
process.add(sep)
process.add(comp)
process.run()
print(f"Compressor power: {comp.getPower()/1e6:.2f} MW")
| Use Case | Recommended Approach |
|---|---|
| Learning & prototyping | Python wrappers |
| Jupyter notebooks | Python wrappers |
| Production applications | ProcessContext |
| Multiple parallel processes | ProcessContext |
| Configuration-driven design | ProcessBuilder |
| Advanced Java features | Direct Java access |
See the examples folder for more process simulation examples, including processApproaches.py which demonstrates all four approaches.
NeqSim also includes a pvtsimulation package for common PVT experiments (CCE/CME, CVD, differential liberation, separator tests, swelling, viscosity, etc.) and tuning workflows.
docs/pvt_simulation.mdexamples/pvtsimulation/README.mdJava version 8 or higher (Java JDK) needs to be installed. The Python package JPype is used to connect Python and Java. Read the installation requirements for Jpype. 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.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
Questions related to neqsim can be posted in the github discussion pages.
NeqSim use SemVer for versioning.
NeqSim is distributed under the Apache-2.0 licence.
A number of master and PhD students at NTNU have contributed to development of NeqSim. We greatly acknowledge their contributions.
FAQs
NeqSim is a tool for thermodynamic and process calculations
We found that neqsim demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.