Fit non-Newtonian flow curve models (Power-law, Herschel-Bulkley, Casson) to shear stress / shear rate data for food rheology.
Project description
rheology-fit
Fit non-Newtonian flow curve models (Power-law, Herschel-Bulkley, Casson) to shear stress / shear rate data, with objective model selection and flow-behavior classification — for sauces, purées, doughs, and other non-Newtonian food fluids.
Problem
Rheological characterization of non-Newtonian food fluids — the relationship between shear stress and shear rate — underpins process design (pumping, mixing, extrusion), texture/mouthfeel prediction, and quality control. Researchers typically measure a flow curve on a rheometer and then fit one or more models (Power-law, Herschel-Bulkley, Casson) by hand in a spreadsheet — a slow, inconsistent process, especially since Herschel-Bulkley requires genuine nonlinear regression that spreadsheets handle poorly. rheology-fit automates model fitting, objective model selection (AIC), and flow-behavior interpretation (shear-thinning/thickening, yield stress), producing a publication-ready report.
Installation
pip install rheology-fit
Or from source:
git clone https://github.com/karenkhachatryan-lab/rheology-fit.git
cd rheology-fit
pip install -e ".[dev]"
Usage
Input CSV with columns shear_rate (s⁻¹), shear_stress (Pa), and optionally shear_stress_std:
shear_rate,shear_stress,shear_stress_std
1,20.6,0.3
10,33.2,0.4
50,47.4,0.5
100,55.6,0.6
Fit models and generate a report:
rheology-fit fit data.csv --output report
This produces:
report.pdf— flow curve with all fitted model curves, flow-behavior annotation, residuals plot for the best model,report.json— fitted parameters, metrics (R², RMSE, AIC), and flow-behavior classification.
Print citation information:
rheology-fit cite
Models
- Power-law (Ostwald-de Waele): τ = K·γ̇ⁿ — 2 parameters, no yield stress.
- Herschel-Bulkley: τ = τ₀ + K·γ̇ⁿ — 3 parameters; the standard model for yield-stress food fluids (ketchup, mayonnaise, purées).
- Casson: √τ = √τ₀ + √(η꜀·γ̇) — 2 parameters; common for chocolate and some dairy/meat emulsions.
Unlike isotherm-fit's BET model, all three models here are fit on the full dataset, so their AIC values are always directly comparable — no restricted-range caveat.
Project status
Early development (v0.1.0) — MVP scope: 3 models, CSV loader, AIC-based model selection, PDF/PNG + JSON report generation, CLI via Typer. See CHANGELOG.md.
Citing this software
If you use rheology-fit in your research, please cite it — see CITATION.cff or run rheology-fit cite for the formatted citation and BibTeX entry. DOI: 10.5281/zenodo.21713809.
Contributing and support
Bug reports, feature requests, and usage questions are all welcome via GitHub Issues.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rheology_fit-0.1.0.tar.gz.
File metadata
- Download URL: rheology_fit-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4524d9eb7f04eb2af8f2ae8da545699d82c9a9a3e7365c9f0acf65fa0cefe7c
|
|
| MD5 |
c3de64760cac3fb1d28e834c035771e6
|
|
| BLAKE2b-256 |
d3a806b0a2088df8b36f43a7e9ba6d220ee4da2c70750a950668fa9a486dfa1f
|
File details
Details for the file rheology_fit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rheology_fit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b264bf43a79262f0784e81ebf33b684075b14e6166fe2e07184b68834d03ff0
|
|
| MD5 |
505026944e007a6d2d952c3ff4996691
|
|
| BLAKE2b-256 |
b12107297de8666741b3f05056772a9a95bc1d793c47adc9e5ebe89d5c48cfc1
|