-
Notifications
You must be signed in to change notification settings - Fork 41
The NeqSim parameter database
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:
-
Create a new parameter database using the SQL script (creates a copy of the embedded Derby database and populates it with the default parameters)
-
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.
Pure component names in embedded neqsim database: https://github.com/equinor/neqsim/blob/master/src/main/resources/neqsim_component_names.txt
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>
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.
Wiki:
- Getting started with NeqSim and GitHub
- Getting started as a NeqSim developer
- The NeqSim parameter database
Docs:
- Modules Overview
- Reference Manual Index
- Developer Setup
- Contributing Structure
- Getting Started Guide
- Usage Examples
- FAQ
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:
- Thermo Module Overview
- Thermodynamics Guide
- Fluid Creation Guide
- Component Database Guide
- Mathematical Models
Docs - Equations of State:
Docs - Flash & Operations:
- Flash Calculations Guide
- Flash Equations and Tests
- Thermodynamic Operations
- Thermodynamic Workflows
- Property Flash Workflows
Wiki: 8. Oil Characterization 9. Aqueous fluids 10. Electrolytes
Docs:
- Fluid Characterization
- TBP Fraction Models
- PVT Fluid Characterization
- Fluid Characterization Mathematics
Docs - Overview:
Docs - Specific Models:
- Viscosity Models
- Viscosity Models (Physical Properties)
- Density Models
- Thermal Conductivity Models
- Diffusivity Models
- Interfacial Properties
- Steam Tables IF97
- Humid Air Calculations
Wiki: 11. Process Calculations
Docs - Fundamentals:
- Process Module Overview
- Process Simulation Guide
- Advanced Process Simulation
- Logical Unit Operations
- Process Control
- Process Controllers
Docs - Advanced Process Logic:
- Process Logic Framework
- Process Logic Implementation
- Process Logic Enhancements
- Advanced Process Logic
- Runtime Logic Flexibility
- Integrated Workflow Guide
- Equipment Factory
- Process Calculator
- Graph-Based Process Simulation
- Parallel Process Simulation
- Recycle Acceleration Guide
- Differentiable Thermodynamics
- Derivatives and Gradients
Compressors & Turbomachinery:
- Compressor Calculations (Wiki)
- Compressor Curves (Wiki)
- Compressors
- Expanders
- Turboexpander Compressor Model
- Ejectors
Pumps:
Separation:
Heat Transfer:
Valves & Flow Control:
Tanks & Storage:
Streams & Mixers:
Reactors:
Wells:
Energy & Special Equipment:
Docs - Overview:
Docs - Single Phase Flow:
Docs - Two-Phase & Multiphase:
Docs - Pressure Drop & Friction:
Docs - Heat & Mass Transfer:
- Pipeline Heat Transfer
- Pipe Wall Heat Transfer
- Heat Transfer
- Interphase Heat Mass Transfer
- Mass Transfer
Docs - Transient Flow:
- Multiphase Transient Model
- Transient Multiphase Pipe
- Pipeline Transient Simulation
- Pipeline Model Recommendations
- Water Hammer Implementation
- Two-Phase Flow Development Plan
Docs - PVT Simulation:
Docs - Black Oil:
Docs - Gas Quality:
Docs - Asphaltene:
- Flow Assurance Overview
- Asphaltene Modeling
- Asphaltene CPA Calculations
- Asphaltene DeBoer Screening
- Asphaltene Method Comparison
- Asphaltene Parameter Fitting
- Asphaltene Validation
Wiki: 18. Dynamic process simulations
Docs:
Docs - Overview:
Docs - Relief & Blowdown:
- PSV Dynamic Sizing
- PSV Dynamic Sizing (Safety)
- Rupture Disk Dynamic Behavior
- ESD Blowdown System
- Fire Blowdown Capabilities
- Fire Heat Transfer Enhancements
Docs - HIPPS:
Docs - Safety Systems:
- Integrated Safety Systems
- SIS Logic Implementation
- Pressure Monitoring ESD
- PSD Valve HIHI Trip
- ESD Fire Alarm System
- Choke Collapse Protection
- Alarm System Guide
- Alarm Triggered Logic Example
- Integration Safety Chain Tests
- Process Safety Scenarios
Docs:
- Standards Overview
- ASTM D6377 RVP
- Dew Point Standards
- ISO 15403 CNG Quality
- ISO 6578 LNG Density
- ISO 6976 Calorific Values
- Sales Contracts
Docs:
Wiki: 15. How to make a NeqSim API
Docs - Overview:
Docs - AI/ML:
Docs - MPC & Control:
Docs - Risk & Safety:
Docs:
- Bottleneck Analysis
- Field Development Planning
- Field Development Engine
- Batch Studies
- Calibration
- Sustainability & Emissions
- Future Infrastructure
- Future API Reference
- Lifecycle Management
Wiki: 12. Adding a thermodynamic model 13. Adding a viscosity model 14. Adding a unit operation
Docs:
Wiki: 16. Create native image using GraalVM 17. Profiling calculations
Jupyter Notebooks:
- ESP Pump Tutorial
- PVT Simulation and Tuning
- MPC Integration Tutorial
- AI Platform Integration
- Graph-Based Simulation
Java Examples:
- Java Test Examples
- Flow Regime Detection
- Multiphase Pressure Drop Comparison
- Transient Pipeline Liquid Accumulation
- Well to Oil Stabilization
External: