Welcome to the NeqSim documentation. This comprehensive wiki provides guides, tutorials, and reference materials for using the library and contributing to development.
About NeqSim
NeqSim (Non-Equilibrium Simulator) is a Java library for estimating fluid properties and process design. The library contains models for:
- Phase behavior using rigorous equations of state (SRK, PR, CPA, GERG-2008)
- Physical properties (viscosity, density, thermal conductivity, interfacial tension)
- Process equipment (separators, compressors, heat exchangers, columns, and other unit operations)
- Pipeline flow (two-phase, multiphase, transient simulation)
- Flow assurance (hydrates, wax, asphaltene, scaling)
Development was initiated at the Norwegian University of Science and Technology (NTNU). NeqSim is part of the NeqSim project.
Quick Start
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.thermo.system.SystemInterface;
import neqsim.thermo.system.SystemSrkEos;
import neqsim.thermodynamicoperations.ThermodynamicOperations;
/**
* Runs a basic SRK TP-flash and validates its gas-state screening results.
*
* @author NeqSim
* @version 1.0
*/
public final class NeqSimQuickStart {
private static final Logger logger = LogManager.getLogger(NeqSimQuickStart.class);
/** Utility class. */
private NeqSimQuickStart() {}
/**
* Run the quick-start flash and fail closed if its gas-state results are invalid.
*
* @param args command-line arguments; unused
*/
public static void main(String[] args) {
SystemInterface gas = new SystemSrkEos(298.15, 50.0);
gas.addComponent("methane", 0.90);
gas.addComponent("ethane", 0.05);
gas.addComponent("propane", 0.03);
gas.addComponent("CO2", 0.02);
gas.setMixingRule("classic");
ThermodynamicOperations operations = new ThermodynamicOperations(gas);
operations.TPflash();
gas.initProperties();
double density = gas.getDensity("kg/m3");
double compressibility = gas.getZ();
require(Double.isFinite(density) && density > 0.0 && density < 200.0,
"Gas density left the validated 0-200 kg/m3 screening range");
require(Double.isFinite(compressibility) && compressibility > 0.0 && compressibility < 2.0,
"Compressibility left the validated 0-2 screening range");
logger.info("Density: {} kg/m3", density);
logger.info("Compressibility: {}", compressibility);
}
/**
* Fail closed when a quick-start engineering contract is not satisfied.
*
* @param condition contract result
* @param message failure description
*/
private static void require(boolean condition, String message) {
if (!condition) {
throw new IllegalStateException(message);
}
}
}
๐ Getting Started
๐งช Thermodynamics & Phase Behavior
โ๏ธ Process Simulation
๐ง Equipment Models
๐ PVT & Reservoir
๐ Standards & Quality
Installation
Maven:
<dependency>
<groupId>com.equinor.neqsim</groupId>
<artifactId>neqsim</artifactId>
<version>3.29.0</version>
</dependency>
Download: GitHub Releases
Resources