Waves. Linear (Airy) waves of period T travel with wave number k from the dispersion relation omega^2 = g k tanh(k h) (omega = 2 pi / T, h = depth). Their energy per area is E = rho g H^2 / 8 and the energy flux (power per metre of crest) is F = E c_g with group speed c_g = (omega/2k)(1 + 2kh / sinh 2kh). Without losses F is constant, so as depth falls c_g falls and the wave grows (shoaling, Green's law). Waves cannot be higher than about 0.78 h; beyond that they break and the excess energy is removed.
Stem drag. A cylinder of diameter b_v in an oscillating flow feels a drag force 0.5 rho C_D b_v u|u| per metre of stem. Averaged over the wave and summed over N stems per square metre (Dalrymple et al. 1984; Mendez and Losada 2004) the power removed from the wave per square metre of bed is eps = (1/(2 sqrt(pi))) rho C_D b_v N (k g / 2 omega)^3 [sinh^3(k a h) + 3 sinh(k a h)] / (3 k cosh^3(k h)) H^3, where a = min(1, h_v/h) is the fraction of the water column filled by vegetation (h_v = canopy height of the stems and roots). The wave then obeys dF/dx = -eps.
Exact solution used as a check. For uniform depth eps = K H^3 and F is proportional to H^2, so dH/dx = -beta H^2 and H(x) = H0 / (1 + beta H0 x). Wave height does not fall exponentially, it falls like 1/x: the first metres of forest remove the most, and doubling the width does not double the protection. The lab's numerical solver (4th-order Runge-Kutta on the flux, depth varying, breaking limit) is compared with this formula in Check 1.
Village. The dike has a crest R_c above still water (including surge). For Rayleigh-distributed waves the share of waves whose crest exceeds the dike is approximately P = exp(-2 (R_c/H_s)^2); it falls very quickly when the wave height falls. Wave energy flux at the dike is also shown, because the force on a structure grows with H squared. Reading: lowering H from 1.0 m to 0.4 m cuts the overtopping share from tens of percent to practically zero for the default dike.
Surge. A storm surge raises the still-water level, which is how this lab uses it: the depth at the forest edge h_edge includes the surge. Deeper water lets larger waves arrive and also lets waves reach stems higher up, but it reduces the filled fraction a = h_v / h of tall water columns. The steady surge flow through the forest, which also loses energy to the stems, is not modelled.
Honest simplifications. One-dimensional transect with long-crested regular waves (a real storm has a spectrum, direction and wind input); linear wave theory with a simple breaking cap (no wave setup, no run-up, no non-linear steepening); stems treated as rigid cylinders with constant drag coefficient (real roots are flexible, and C_D depends on Reynolds number and density); no bed friction; the dike and village do not reflect energy back. Field studies find a wide range of wave reduction per 100 m of mangrove (reported roughly in the range of 13 to 66 percent in reviews, recalled approximately: check the primary literature before quoting); the model parameters N, b_v and C_D mix to give the same range but are illustrative, not site measurements. Do not use this lab to design coastal protection.