96 retention models
8 basic × {uni·bi·tri-modal} × 4 variants (original·Brunswick·PDI·FXW).
Documentation
A complete, hands-on guide to fitting soil water-retention curves (SWRC, θ(h)) and hydraulic-conductivity curves (HCC, K(h)) with 96 retention models, 6 conductivity models, three fit objectives, and bootstrap or likelihood uncertainty. This manual applies to both the web app and the desktop app — the interface is identical.
Teaching a class? See the short, student-friendly classroom guide built around the app's Learner mode (soil presets + manual curve preview).
The SWRC/HCC Fitter estimates the two functions that govern unsaturated water flow in soil:
pF = log₁₀(h in cm)).You upload measured points, pick a model, and the app fits the model parameters by global optimisation (differential evolution), then shows the fitted curves, parameters with confidence intervals, goodness-of-fit metrics, and uncertainty bands. You can overlay and compare many models at once.
8 basic × {uni·bi·tri-modal} × 4 variants (original·Brunswick·PDI·FXW).
Mualem, Burdine, Alexander–Skaggs, Childs–Collis-George, plus Gardner exponential & power — with any retention curve.
nRMSE, NSE, or Gaussian NLL (which also calibrates the noise σ).
Bootstrap intervals/bands, or likelihood (NLL) bands — one per model.
The app is the same in both places, so every step in this manual applies to both.
Open PTF.bluerror.com in any modern browser. Your data is processed in a private session and is not stored.
SWRC-HCC-Fitter-setup.exe from the latest release.Web vs desktop differences are cosmetic only: the desktop app runs in its own window and handles file dialogs natively; the web app opens in a browser tab. The fitting engine and every control are identical.
The app reads CSV, text, and Excel (.xlsx / .xls) files. You can provide the two branches separately or in one combined file.
Columns are auto-detected, and you confirm the mapping in the toolbar.
A retention file with a suction column and a water-content column, and a conductivity file with a suction column and a conductivity column. Suction can be given as pF (= log₁₀ of cm of head).
| RetMeas.csv | CondMeas.csv |
|---|---|
|
|
pF — suction as log₁₀(h/cm). E.g. pF 2 = 100 cm ≈ 10 kPa; pF 4.2 ≈ permanent wilting point.theta — volumetric water content (cm³/cm³), e.g. 0.0–0.5.K — unsaturated conductivity in your own units (e.g. cm/day). Must be positive (it is fitted in log space).Use a sample_id column plus separate suction columns for each branch. Leave cells blank where a
branch has no measurement on that row.
sample_id,pF_theta,theta,pF_K,K
Loam_A,0.00,0.4294,0.50,38.73
Loam_A,1.50,0.3310,1.40,4.467
Loam_A,2.30,0.1738,2.30,0.00922
Sand_B,0.00,0.3790,0.50,290.4
Sand_B,1.50,0.2104,1.40,55.13
A sample may have only retention or only conductivity — whichever branch is present is fitted. If your suction is in kPa or cm, convert to pF with pF = log₁₀(head in cm) (1 kPa ≈ 10.2 cm).
The app ships with three public soil hydraulic databases. In the toolbar, open
“No data? Try a database”, pick a source and a soil sample, and click
Load — the measured retention and conductivity are loaded ready to fit
(your own uploads are never touched). You can also download the whole collection as an
Excel workbook (one *_SWRC and one *_HCC sheet per source, each
with Sample_ID and pF).
Please also cite the database(s) you use:
Smart reader. Drop in CSV, text, or Excel — the app figures out the rest. It auto-detects the separator (comma, semicolon, or tab) and decimal mark (so European / LabView exports using ; with a , decimal load directly), picks the right worksheet in an Excel workbook, and finds where the data table starts even when there are metadata/preamble rows above it (common in instrument exports). It also auto-detects whether the conductivity column is K or already log₁₀(K) (name contains “log”, or any value ≤ 0), so it never double-logs. No setup — and if a guess is off, just re-pick the columns in the toolbar.
pF/θ and Conductivity pF/K dropdowns (auto-guessed). Pick a sample_id column and a single sample if you have several.The toolbar groups the inputs: the upload zone, then Retention θ(h) (pF, θ), Conductivity K(h) (pF, K), and Sample (ID column + one sample). Hover the ⓘ badge on any panel for an in-app explanation.
The matrix has one row per retention function and one column per variant (original · Brunswick · PDI). Click a cell to set the base model (highlighted blue). Above the matrix, switch the modality (unimodal / bimodal / trimodal). Below it, choose the conductivity (K) model.
| Variant | What it adds | Source |
|---|---|---|
| original | Classic capillary model. θ(h) reaches a residual θr. | — |
| Brunswick | Adds a non-capillary (film/adsorptive) term so θ→0 at oven dryness; extra film-conductivity terms. Uses θcs/θncs notation. | Weber et al. 2019 |
| PDI | Peters–Durner–Iden adsorptive saturation; θ→0 at pF 6.8. Adds Ksnc, a; tortuosity τs. | Peters, Durner & Iden 2024 |
| FXW | Fredlund–Xing–Wang: multiplies the capillary curve by the FX oven-dryness correction C(h) so θ = θs·C(h)·Se → 0. Adds correction head hr. | Rudiyanto et al. 2020 |
| Control | Meaning |
|---|---|
| bootstrap | Number of resample-and-refit rounds used to build 2.5–97.5% intervals and curve bands. 0 = off (fastest). Used for nRMSE/NSE. |
| max iter | Differential-evolution generations. Higher = more thorough optimisation (and slower). 150 is a good default. |
| Fit metric | The objective — see §5.4 and §8. |
Two tables — retention and conductivity — list each parameter with its fitted Value and 2.5% / 97.5% interval. Symbols follow the selected variant's source paper (e.g. α, n, θr, θs; for Brunswick θcs, θncs; for PDI Ksnc, τs). Untick a row's checkbox to hold that parameter fixed during the fit. restore parameters resets to defaults.
Toggle the three square plots independently: Retention θ(h), Conductivity K(h), and Conductivity K(θ). Measured points are shown as dots; fitted models as lines; the shaded band is the 95% uncertainty (coloured to match each model). A standalone legend sits to the right so the plots stay square.
For the selected model: RMSE · NSE · KGE · NLL for each branch (θ and K), the corrected AICc (lower = better, penalises extra parameters), the calibrated/fixed σ, and water-content / plant-available-water summaries at standard suctions. When several models are fitted, a dropdown lets you inspect each one.
Hold Ctrl (or ⌘) and click extra cells in the matrix to overlay more models. Each curve gets its own distinct colour (the base model is blue); its uncertainty band matches. A plain click resets to a single base model.
In the desktop app a Save dialog appears; in the browser files download normally.
Tick 🎓 Learner mode under the model matrix to reveal two teaching tools:
A short, student-ready walkthrough lives in the classroom guide.
These use the downloadable sample files from §3. Grab RetMeas.csv, CondMeas.csv, and two_samples.csv first.
RetMeas.csv and CondMeas.csv together (select both, or drop both).pF→pF, θ→theta; Conductivity pF→pF, K→K. Sample column = none (fit all rows).0, max iter 150. Press Fit.30 and re-fit to add 95% bands and parameter intervals.If the curve looks under-fitted, raise max iter (e.g. 300). Differential evolution is global, so more generations = a more accurate optimum.
two_samples.csv. Set the Sample ID column to sample_id and
pick Loam_A (the dropdown fits one sample at a time).pF_theta/theta and pF_K/K.| Function | Shape parameters | Note |
|---|---|---|
| van Genuchten (m = 1−1/n) | α, n | The default; smooth sigmoid. |
| van Genuchten (m, n free) | α, n, m | Extra flexibility near saturation. |
| Brooks–Corey | α, λ | Sharp air-entry break. |
| Kosugi | hm, σ | Lognormal pore-size distribution. |
| Fredlund–Xing (constrained & m free) | α, n (, m) | Good over a wide suction range. |
| Campbell (1974) | α, b | Power form / Brooks–Corey-like. |
| Vogel–Císlerová (air-entry vG) | α, n, hae | vG with an explicit air-entry head. |
Each comes in unimodal / bimodal / trimodal (1–3 superimposed pore systems, mixed by weights w) and four variants (original / Brunswick / PDI / FXW): 8 × 3 × 4 = 96 retention models.
| Model | Exponents | Reference |
|---|---|---|
| Mualem ⭐ (recommended) | q=1, r=2 | Mualem 1976 |
| Burdine | q=2, r=1 | Burdine 1953 |
| Alexander–Skaggs | q=1, r=1 | Alexander & Skaggs 1986 |
| Childs–Collis-George | moment integral | Childs & Collis-George 1950 |
The HCC adds saturated conductivity Ks and a tortuosity τ; Brunswick and PDI add film/non-capillary terms (Ksnc, a). Any conductivity model combines with any retention curve.
| Metric | Range / best | Meaning |
|---|---|---|
| RMSE | ≥ 0, lower | Root-mean-square error in the branch's own units (θ, or log₁₀K). |
| NSE | ≤ 1, best = 1 | Nash–Sutcliffe efficiency; 1 = perfect, 0 = no better than the mean. |
| KGE | ≤ 1, best = 1 | Kling–Gupta efficiency; balances correlation, bias, and variability. |
| NLL | lower | Gaussian negative log-likelihood; rewards an accurate mean and a small calibrated σ. |
| AICc | lower | Corrected Akaike criterion — fit quality penalised by the number of parameters. Use it to pick between models. |
Which model is “best”? Prefer the lowest AICc — it stops you from over-fitting with a model that simply has more parameters. NSE/KGE near 1 and small RMSE confirm the fit visually.
| Symptom | Fix |
|---|---|
| Nothing happens after upload | Map at least one full branch: (pF + θ) or (pF + K). Check the column dropdowns. |
| Fit looks too coarse / under-optimised | Increase max iter (200–400). Differential evolution improves with more generations. |
| No uncertainty band | For nRMSE/NSE set bootstrap ≥ 20. For NLL the band is automatic. |
| K won't fit / errors | K must be positive (it is fitted in log space). Remove zeros/negatives. |
| Curves vanish in the dry range | Use the Brunswick or PDI variant — they keep film conductivity and θ→0. |
| One sample only | The sample dropdown fits one sample at a time by design; switch it to fit another. |
pF = log₁₀ of suction in cm of water. pF 2 = 100 cm (~10 kPa, field-capacity-ish); pF 4.2 ≈ 1500 kPa (permanent wilting point); pF 6.8 ≈ oven dryness.
No. Fit either branch alone, or both together. With both, the chosen metric balances them on a common scale.
The web app processes data in a transient session and does not store it; the desktop app runs entirely on your machine.
That is the Gaussian maximum-likelihood estimate: σ̂ = √(SSE/N) = RMSE. NLL calibrates the mean and σ jointly.
Mualem (q=1, r=2) is the recommended default and works well with most retention curves.
How to cite. If you use SWRC/HCC Fitter, please cite: Shojaeezadeh, S.A. SWRC/HCC Fitter tool for fitting soil water retention and hydraulic conductivity curves over the full moisture range (under review).
Built on the pyspsh forward model · numerical fitting in NumPy + SciPy. Released under the MIT License.