Central repository for experimental data, parameter fitting, and model validation for NeqSim - the thermodynamic and fluid behavior simulation library.
This repository provides:
- Experimental Data: Curated datasets for thermodynamic properties (VLE, density, viscosity, etc.)
- Fitting Utilities: Python package for parameter optimization
- Evaluation Tools: Standard metrics and visualization for model comparison
- Parameter Registry: Version-controlled fitted parameters
- Report Generation: Automated documentation of fitting results
# Clone the repository
git clone https://github.com/equinor/neqsim-parameterfitting.git
cd neqsim-parameterfitting
# Install Python package
pip install -e ./python
# Or with all optional dependencies
pip install -e "./python[all]"from neqsim_fitting.data import load_vle_data, get_data_summary
from neqsim_fitting.evaluation import calculate_all_metrics, parity_plot
from neqsim_fitting.fitting import VLEFitter
# Load experimental data
df = load_vle_data('data/thermodynamics/VLE/water-CO2.csv')
print(get_data_summary(df))
# Fit parameters
fitter = VLEFitter('CO2', 'water', equation_of_state='cpa')
result = fitter.fit_kij(df, fit_kij_T=True)
# Evaluate results
print(result.summary())
parity_plot(df['x1'], result.calculated_values)neqsim-parameterfitting/
βββ data/ # Experimental datasets
β βββ schema/ # JSON schemas for validation
β βββ physicalproperties/ # Viscosity, conductivity, etc.
β βββ thermodynamics/ # VLE, density, Cp, etc.
βββ example/ # Jupyter notebooks
β βββ thermodynamics/
β βββ physicalproperties/
βββ parameters/ # Fitted parameter registry
β βββ registry.yaml # Index of all parameters
β βββ fitted/ # Individual parameter files
βββ python/ # Python utilities package
β βββ neqsim_fitting/
βββ reports/ # Generated reports
β βββ templates/ # Jinja2 templates
β βββ generated/ # Output reports
βββ scripts/ # Utility scripts
βββ src/ # Java fitting code
βββ templates/ # Notebook templates
βββ pyproject.toml # Python project config
| Property | Pure Components | Binary Mixtures |
|---|---|---|
| VLE | - | CO2-water, methane-water, nitrogen-water, oxygen-water |
| Density | hydrogen, water, MEG, TEG | hydrogen-methane |
| Viscosity | hydrogen, water | hydrogen-methane |
| Heat Capacity | CO2, hydrogen, methane, nitrogen, oxygen, TEG, water | - |
| Thermal Conductivity | hydrogen, TEG | hydrogen-methane |
| Speed of Sound | - | hydrogen-methane |
- Load Data using standardized loaders
- Validate against schemas
- Evaluate Baseline model performance
- Fit Parameters using optimization
- Validate Results with metrics and plots
- Export fitted parameters and reports
See the template notebooks for complete examples.
All fitted parameters are stored in the parameters/ directory with:
- YAML format for easy reading and version control
- Complete metadata (valid range, data sources, metrics)
- Usage examples for NeqSim
Browse the parameter registry for available parameters.
from neqsim.thermo.thermoTools import fluid, TPflash
# Create fluid with fitted parameters
fluid1 = fluid('cpa')
fluid1.addComponent('CO2', 1.0)
fluid1.addComponent('water', 100.0)
fluid1.autoSelectMixingRule()
# Perform flash calculation
fluid1.setTemperature(25, 'C')
fluid1.setPressure(50, 'bara')
TPflash(fluid1)
# Get results
x_CO2 = fluid1.getPhase('aqueous').getComponent('CO2').getx()
print(f"CO2 solubility: {x_CO2:.6f} mol/mol")See the NeqSim Wiki for more information.
Call mvn validate to install the NeqSim core jar file located in resources folder to a local maven repository. Then the neqsim package shall be available for the java code. Try it out by calling mvn test.
See notebook on how to work with the NeqSim parameter database, and the description in the neqsim wiki.
We welcome contributions! Please see our Contributing Guide for details.
- Add experimental data: Follow the data format standards
- Fit new parameters: Use the template notebooks
- Report issues: Use the issue templates
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- NeqSim - Main thermodynamic library
- neqsim-python - Python wrapper
- NeqSim-Colab - Jupyter notebooks
- GitHub Issues: Create an issue
- NeqSim Wiki: Parameter Database