Skip to main content

rheology-fit

License: MIT Status DOI

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.

Metadata

Release files for rheology-fit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rheology-fit 0.1.0
File Size Uploaded
rheology_fit-0.1.0.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rheology-fit 0.1.0
File Interpreter ABI Platform
rheology_fit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.5 kB

Release files / rheology_fit-0.1.0.tar.gz

Download URL rheology_fit-0.1.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f4524d9eb7f04eb2af8f2ae8da545699d82c9a9a3e7365c9f0acf65fa0cefe7c
BLAKE2b-256 checksum
How to use checksums
d3a806b0a2088df8b36f43a7e9ba6d220ee4da2c70750a950668fa9a486dfa1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / rheology_fit-0.1.0-py3-none-any.whl

Download URL rheology_fit-0.1.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b264bf43a79262f0784e81ebf33b684075b14e6166fe2e07184b68834d03ff0
BLAKE2b-256 checksum
How to use checksums
b12107297de8666741b3f05056772a9a95bc1d793c47adc9e5ebe89d5c48cfc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page