Skip to content

The NeqSim parameter database

Even Solbraa edited this page Oct 30, 2025 · 52 revisions

NeqSim reads the model parameters (such as Tc, Pc, acentric factor, kij, etc.) from a SQL database via a JDBC connection. See discussion: https://github.com/equinor/neqsim/discussions/1587

By default H2 is used as the data base engine (from version 2.4.4 of neqsim) by creating an in memory database when neqsim is initiated.

A Java H2 database is embedded in the source code distribution, and is the default parameter database used by NeqSim. The access to the parameter database is controlled via the NeqSimDatabase class.

The parameter tables used by H2 are stored as CSV files. New components can be seen/added by modifying the COMP.csv file (pure component parameters). Interaction parameters can be seen/added by modifying the INTER.csv file. Please make an issue/pull request if new components should be added or parameters updated. See this pull request for an example of how to add a new component to the database.

Alternative parameter databases can be used by inserting required tables, and setting the JDBC connection in the NeqSimDatabase.class. A simple way to create a new parameter database used by NeqSim is:

  1. Create a new parameter database using the SQL script (creates a copy of the embedded Derby database and populates it with the default parameters)

  2. Modify the connection string in the [NeqSimDatabase class], eg.(https://github.com/equinor/neqsimsource/blob/master/src/main/java/neqsim/util/database/NeqSimDataBase.java):

neqsim.util.database.NeqSimDataBase.setDataBaseType("mySQL"); neqsim.util.database.NeqSimDataBase.setConnectionString("jdbc:mysql://tr-w33:3306/neqsimthermodatabase");

The database contains all parameters needed for doing simulations with NeqSim database. Examples of tables in the database are the COMP table with the pure component parameters (TC, PC, acentric factor) and the INTER table with binary interaction coefficients (kij).

The NeqSim database parameter can be viewed or edited in a jdbc database viewer. The databases editor in the Eclipse IDE is typically set to view or edit the NeqSim database (the database must be extracted from the NeqSim jar library to the local disk before editing). To access the embedded database: user/pass remote/remote.

Viewing and editing parameters in Eclipse

Pure component names in embedded neqsim database: https://github.com/equinor/neqsim/blob/master/src/main/resources/neqsim_component_names.txt

Using a MySql database

Include MySql library on classpath by adding the dependency in the pom.xml.

		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>8.0.27</version>
		</dependency>

Using a MS Access database

The NeqSim parameter database in MS Access format is downloadable from this link: https://github.com/equinor/neqsim/blob/master/docs/wiki/NeqSimDatabase.mdb

Add the following dependencies in the pom.xml.

                <dependency>
			<groupId>org.ojalgo</groupId>
			<artifactId>ojalgo</artifactId>
			<version>48.4.2</version>
		</dependency>
		<dependency>
			<groupId>org.xerial</groupId>
			<artifactId>sqlite-jdbc</artifactId>
			<version>3.34.0</version>
		</dependency>
		<dependency>
			<groupId>net.sf.ucanaccess</groupId>
			<artifactId>ucanaccess</artifactId>
			<version>5.0.1</version>
		</dependency>

Add the following to the NeqSimDataBase.java for the correct path to the database.

static String dataBaseType = "MSAccessUCanAccess";
  public static String connectionString =
      "jdbc:ucanaccess:///workspaces/neqsim/NewDataBase/NeqSimDatabase.mdb;memory=true";

or alternatively in your program

`neqsim.util.database.NeqSimDataBase.setDataBaseType("MSAccessUCanAccess");
neqsim.util.database.NeqSimDataBase.setConnectionString("jdbc:ucanaccess:///workspaces/neqsim/NewDataBase/NeqSimDatabase.mdb;memory=true");`

where workspaces/neqsim/NewDataBase/NeqSimDatabase.mdb is the local path to the MS Access database file.

πŸš€ Getting Started

Wiki:

  1. Getting started with NeqSim and GitHub
  2. Getting started as a NeqSim developer
  3. The NeqSim parameter database

Docs:


πŸ§ͺ Thermodynamics

Wiki: 4. Setting up a fluid and flash calculations 5. Select EOS and mixing rule 6. Flash and phase envelope calculations 7. Thermodynamic and physical properties

Docs - Fundamentals:

Docs - Equations of State:

Docs - Flash & Operations:


πŸ›’οΈ Fluid Characterization

Wiki: 8. Oil Characterization 9. Aqueous fluids 10. Electrolytes

Docs:


πŸ”¬ Physical Properties

Docs - Overview:

Docs - Specific Models:


βš™οΈ Process Simulation

Wiki: 11. Process Calculations

Docs - Fundamentals:

Docs - Advanced Process Logic:


πŸ”§ Equipment Models

Compressors & Turbomachinery:

Pumps:

Separation:

Heat Transfer:

Valves & Flow Control:

Tanks & Storage:

Streams & Mixers:

Reactors:

Wells:

Energy & Special Equipment:


🌊 Pipeline & Multiphase Flow

Docs - Overview:

Docs - Single Phase Flow:

Docs - Two-Phase & Multiphase:

Docs - Pressure Drop & Friction:

Docs - Heat & Mass Transfer:

Docs - Transient Flow:


πŸ“Š PVT & Black Oil

Docs - PVT Simulation:

Docs - Black Oil:

Docs - Gas Quality:


🧊 Flow Assurance

Docs - Asphaltene:


⚑ Dynamic & Transient Simulation

Wiki: 18. Dynamic process simulations

Docs:


πŸ›‘οΈ Safety & Relief Systems

Docs - Overview:

Docs - Relief & Blowdown:

Docs - HIPPS:

Docs - Safety Systems:


πŸ“ Standards & Quality

Docs:


πŸ“ˆ Statistics & Parameter Fitting

Docs:


πŸ”Œ Integration & APIs

Wiki: 15. How to make a NeqSim API

Docs - Overview:

Docs - AI/ML:

Docs - MPC & Control:

Docs - Risk & Safety:


🏭 Optimization & Planning

Docs:


πŸ› οΈ Extending NeqSim

Wiki: 12. Adding a thermodynamic model 13. Adding a viscosity model 14. Adding a unit operation

Docs:


⚑ Performance & Deployment

Wiki: 16. Create native image using GraalVM 17. Profiling calculations


πŸ“š Examples & Tutorials

Jupyter Notebooks:

Java Examples:

External:


πŸ”— Quick Links

Clone this wiki locally