# density-calc **Repository Path**: pisonics/density-calc ## Basic Information - **Project Name**: density-calc - **Description**: 浆液密度换算体积浓度、质量浓度、干料吨/时与原状方量。用于疏浚与选矿,纯 Python 零依赖,带单元测试。 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: main - **Homepage**: https://www.pisonics.cn/guides/dredge-production-calculation-density-flow - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-18 - **Last Updated**: 2026-10-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: dredging, slurry, mineral-processing ## README # slurrycalc — slurry concentration and dredge production English · [中文](README.zh-CN.md) Convert a measured **slurry density** into volume concentration, mass concentration, dry-solids tonnage and in-situ bank volume. Pure Python, no dependencies, unit tested against a published worked example. Written for dredging and mineral processing, where a density meter's output has to become the number a contract settles on. ```bash python -m slurrycalc --density 1.30 --material "quartz sand" --flow 7000 --seawater ``` ``` carrier density 1.025 t/m3 solids density 2.650 t/m3 (quartz sand, indicative) mixture density 1.300 t/m3 volume conc. Cv 16.92 % mass conc. Cw 34.50 % dry solids 3139.2 t/h sensitivity 0.01 t/m3 of density error = 3.6 % of production ``` Or as a library: ```python from slurrycalc import dry_solids_rate, volume_concentration, WATER_SEA cv = volume_concentration(rho_m=1.30, rho_s=2.65, rho_w=WATER_SEA) # 0.1692 tph = dry_solids_rate(flow_m3h=7000, rho_m=1.30, rho_s=2.65, rho_w=WATER_SEA) ``` ## The formulas With `rho_m` measured, `rho_w` the carrier, `rho_s` the solid particles: ``` Cv = (rho_m - rho_w) / (rho_s - rho_w) volume fraction Cw = Cv * rho_s / rho_m mass fraction P = Q * Cv * rho_s dry solids, t/h Vb = Q * Cv / (1 - n) bank volume, m3/h ``` Full derivation and worked example: https://www.pisonics.com/guides/dredge-production-calculation-density-flow ## What actually drives the error Ranked, because it is rarely what people argue about: 1. **Density measurement error dominates.** Differentiating `Cv` shows it is amplified by `1 / (rho_s - rho_w)`. On sand at 1.30 t/m³ in seawater, 0.01 t/m³ of density error is about **3.6 %** of reported production. `production_error_from_density_error()` computes this for your case. 2. **Assumed solids density is a silent bias.** Everyone writes 2.65 for sand. Clay, silt, mixed spoil and shell content are not 2.65. An assumption 3 % high puts a 3 % bias into every tonne, for the whole job. The `SOLIDS` table here is indicative only — confirm against your own material. 3. **Entrained air under-reports.** Air lowers mixture density, so production reads low during air ingress — the direction that costs the contractor. 4. **Flow measurement**, usually the smallest, provided the pipe runs full. ## Bank volume is where settlements get argued `bank_volume_rate()` needs in-situ porosity `n`, which is almost always assumed rather than measured. That assumption, not the instrument, is why bank-volume settlements are disputed more often than tonnage ones. If your contract is written in bank cubic metres, agree the porosity figure in advance and in writing. ## Tests ```bash python tests/test_slurrycalc.py ``` The tests pin the published worked example, check the round trip, and assert the sensitivity figure quoted above — so the documentation and the code cannot drift apart silently. ## More modules (added 2026-10) Small, dependency-free tools that keep coming up around inline density and concentration measurement, each with unit tests: | Module | What it does | |---|---| | `slurrycalc.table` | Density-to-concentration lookup table for your own ore (CSV); back-calculates the effective solids density from a sample | | `slurrycalc.water` | Density, sound speed and acoustic impedance of pure water vs temperature (Kell 1975 / Marczak 1997) | | `slurrycalc.dp` | Error budget for two-tap differential-pressure density: transmitter, entrained gas, wall friction, capillary temperature, all in kg/m3 | | `slurrycalc.vibrating` | K0, K1, K2 least-squares calibration for tuning-fork / vibrating-tube meters; air check for deposits | | `slurrycalc.filters` | Running median, Hampel identifier, first-order lag (transmitter damping) | | `slurrycalc.compare` | Meter-vs-laboratory comparison: bias, MAE, regression, Bland-Altman limits, sign pattern | | `slurrycalc.interp2d` | Concentration-temperature calibration grids: interpolation, inversion, turning points, temperature leverage; includes measured hydrochloric-acid sound-speed data | ```bash python -m slurrycalc.table --solids 2.8 --from 1.05 --to 2.00 --step 0.01 > table.csv python -m slurrycalc.water python -m slurrycalc.dp python -m slurrycalc.interp2d python tests/test_extras.py ``` ## About Pisonics [Pisonics](https://www.pisonics.com) builds inline density and concentration meters for dredging, mining, power and chemical processing. The [PS7000](https://www.pisonics.com/products/PS7000) measures slurry density by acoustic impedance across DN50–DN1000 with no radioactive source — see also [non-nuclear density meters for dredgers](https://www.pisonics.com/guides/non-nuclear-density-meter-for-dredgers). MIT licensed.