PD20 — the physics

Every constitutive law in the model, with its source.

Every law the simulator uses

The complete constitutive basis of the model, with the source for each. Nothing here is proprietary — this is the physics, and it is meant to be checked.

The model is built so that a reader can disagree with it precisely. Every flux below is one constitutive law taken from the literature, applied to pools that conserve mass by construction. None of them is tuned to produce an expected outcome; where a constant could not be sourced, it is labelled as such on the calibration table rather than presented as if it were measured.

What is not on this page. How the device decides — the control algorithm's structure, gains, set-points and training procedure — is withheld as a pending patent matter. What governs how the body and the membrane behave is here in full. The distinction matters for reproducibility: everything needed to re-derive the physics results is published; only the controller that chooses the prescription is not.

Conservation

Paired water transfer
V_src −= v ;  V_dst += v ;  n_s,src −= c_s·v ;  n_s,dst += c_s·v

Every process that moves water moves its carried solute in the SAME atomic update, clamped to the source pool. Water and each solute are therefore invariant under any sequence of transfers — mass cannot be created or destroyed by a modelling error, only sent to the wrong place. Measured residual across a 30-day ten-patient cohort: order 1e-8.

Paired solute transfer
n_s,src −= m ;  n_s,dst += m,   clamped so neither pool goes negative

Diffusive transport moves solute without water, by the same atomic rule.

Peritoneal membrane

Ultrafiltration (Starling)
J_v,i = K_f·a_i·w·(ΔP_i + Δπ_i)·dt

Water crosses the membrane driven by the hydrostatic difference between capillary and intraperitoneal pressure plus the summed osmotic terms. a_i is the slab's share of wall area; w scales transport to zero on a near-dry cavity.

Rippe three-pore; Starling 1896

Osmotic pressure difference, crystalloids
Δπ_cryst = Σ_s σ_s·R·T·(C_s,dialysate − C_s,serum)

Van't Hoff, valid for small solutes at these concentrations. R·T = 19.34 mmHg per mmol/L at 310.15 K. σ is the osmotic reflection coefficient.

Rippe et al., Perit Dial Int 2004;24(1):10-27, PMID 15104333

Colloid osmotic pressure, protein
COP = 2.1·C + 0.16·C² + 0.009·C³,   C = total plasma protein g/dL

Plasma protein is strongly non-ideal, so van't Hoff underestimates its osmotic pressure by about 40% at physiologic concentration. Applied to albumin plus globulin, evaluated on each side and differenced, then weighted by a mass-weighted protein reflection coefficient.

Landis & Pappenheimer, Handbook of Physiology Sect 2 Vol II, 1963, p.975

Convective solute drag (sieving)
ṅ_s = S_s·C_s,serum·J_v

Solute swept through the pores with the ultrafiltrate. S is the convective sieving coefficient and is independent of σ: water crossing aquaporin-1 carries no solute at all, which is why the small-solute class is discounted by the free-water fraction.

Rippe 2001, PMID 11687943; free-water transport 40–50% — Bernardo 2012, Helman 2024 PMC10914194

Diffusive transport
J_s = MTAC_s·a_i·w·(C_s,serum − r^z·C_s,dialysate)·dt

Fick across the membrane, scaled by the slab's area share. The Gibbs–Donnan factor r applies because albumin cannot cross: anions equilibrate to r×dialysate and cations to dialysate/r.

Smit 2003; Rippe. Donnan charge from Figge, Mydosh & Fencl, J Lab Clin Med 1992;120:713

Total peritoneal fluid absorption
J_abs,i = L·(V_i/V_perit)·w·dt,   L = 1.07 mL/min

Apportioned by slab volume fraction. This is TOTAL absorption, not lymphatic flow alone — true lymph is 0.2–0.3 mL/min; the name in the source should not be read as claiming otherwise.

Imholz et al., Kidney Int 1993;44:1078-85, PMID 8264138

Intraperitoneal pressure
IAP(V) = IAP_base + 4.0·V  [cmH₂O],  plus the standing water column per slab

Linear in intraperitoneal volume, anchored so that 2.82 L gives 13 cmH₂O supine.

Durand 1993, PMID 8105960 (13 cmH₂O at 2.82 L, 34 CAPD patients); linearity to 5 L, Durand 1994, PMID 7999866

Membrane area recruitment
A(V) ∝ V^0.437

Effective peritoneal area grows sub-linearly with intraperitoneal volume, so MTAC and K_f track the current dwell volume rather than being frozen at the prescribed fill.

Cavity geometry and mixing

Ovoid cavity, horizontal slabs
V_i, A_wall,i, z_i from the ovoid section at fluid height h(V)

The cavity is divided into horizontal slabs, each with its own volume, wall area and hydrostatic depth. Fresh dialysate enters the top slab and drains from the floor, so a real vertical concentration gradient forms.

Inter-slab mixing
implicit backward-Euler tridiagonal solve on dz = h/N

Adjacent slabs exchange solute by diffusion, solved implicitly so clearance is independent of the number of slabs. The dispersion coefficient is an EDDY parameter, not a molecular diffusivity — no in-vivo value exists.

Dedrick & Flessner, PMID 9086004, describe intraperitoneal mixing as an open knowledge gap

Whole-body physiology

Transcellular water partition
V_serum* = A·(V_serum+V_ICF)/(A+B),  A = 2·Na + glucose,  B = ICF osmoles

Water redistributes so serum and intracellular fluid are iso-tonic at the current effective osmolality. Placed at equilibrium each step, so it cannot oscillate or drain the cell. Rising serum glucose pulls water out of cells — translocational hyponatraemia.

Katz; Hillier

Potassium regulation
aldosterone-gated renal secretion + transcellular buffer

Intracellular potassium is a real reservoir with an intercompartmental clearance; renal secretion is gated by an aldosterone factor rising with serum potassium.

Skeletal reservoir
J = k_bone·(C_serum − C_setpoint)

Calcium, phosphate and magnesium exchange with a bone pool. Applied on the per-solute distribution volume, not the whole serum volume.

Endogenous acid production
0.8 mmol/kg/day, delivered as retained anion

Net endogenous acid production on a Western diet, which is part of why ESRD is a high-anion-gap acidosis.

Remer & Manz 1995, PMID 7797810; Frassetto 1998, PMID 9734733

Hepatic protein replacement
first-order restoration toward baseline, capped at a physiologic net synthesis reserve

Albumin and globulin are both lost to the effluent and both replaced. Without this, protein falls monotonically and the oncotic opposition to ultrafiltration collapses.

Osmotic thirst
intake = clamp(0.8 + deficit/0.5, 0.5, 6.0) L/day,  deficit = TBW·(osm−285)/285

Drinking is driven by the free-water deficit and clamped at a physiologic ceiling. Osmotic thirst drinks ~free water, not saline — the sodium load is diet-driven and independent of it.

Residual renal function
per-solute clearance scaled by the residual GFR fraction, with urine concentrating factors

Where present, the remaining kidney clears solute and water alongside the device.

Cori cycle
1 lactate → 1 bicarbonate

Lactate absorbed from the dialysate is metabolised to bicarbonate, charge-paired.

Dialysate regeneration

Reverse-osmosis water flux
J_w = A·(ΔP − β·π_bulk)

Solution–diffusion. The wall, not the bulk, sets the opposing osmotic pressure, so concentration polarisation is solved together with the flux.

Wijmans & Baker, J Membr Sci 1995;107:1

Solute rejection
R_s = 1 − B_s/(B_s + J_w) ;  c_permeate = β·c_feed·(1 − R_s)

Per-solute rejection from the solution–diffusion model. The feed is fully partitioned into permeate plus reject, so the regeneration circuit conserves mass by construction.

Concentration polarisation
β = exp(J_w/k)

Film theory. β = 1 by default, which reproduces the unpolarised engine exactly, so enabling it is opt-in and no published number moves until it is switched on.

Wijmans & Baker; Baker, Membrane Technology and Applications

Safety limits

Fatal conditions
serum concentration outside its physiologic band, BUN > 150 mg/dL, or |Δ body water| > 10% of body weight

Checked every step. The volume trip is computed on body water EXCLUDING the device-instilled dwell, so a normal fill cannot trigger it, and it catches iso-tonic overload that leaves every concentration normal.

Dialysate electroneutrality
Cl = Na + K + 2Ca + 2Mg − (HCO₃ + lactate),  asserted within a safe band

The prescribed chloride is DERIVED, never chosen. The assertion is enforcing: it has stopped a prescription before a single patient was simulated.

Not modelled — stated so that absence is not mistaken for a claim

The source implementing every law above is published in full on the source code page.