Ok, let's give this a go. For simplicity, I will use a sucrose/water solution (after all that's what Plato and Brix used, and we pretend that beer behaves the same way.)
Water has a density of 0.9982 g/cm^3 at 68°F (20°C), and sucrose has a density of 1.587 g/cm^3. Let's assume we start with 20 L of a 15°P solution (15% by weight of sucrose.) 15°P corresponds to an SG of 1.06111 (from NIST tables), so 20 L weighs 20 L* 998.2 g/L * 1.06111 = 21,184 g (21.184 kg.) The weight of the sucrose is 21,184 g * 0.15 = 3177.6 g, and the water weighs 21,184 g * 0.85 = 18,006.4 g.
Each 342.30 g of sucrose that is fermented creates 4 * 44.01 g = 176.04 g of CO2, 4 * 46.07 g = 184.28 g of ethanol (EtOH), and consumes 18.01 g of water. So, if we ferment all of the sucrose we create:
3177.6 * 176.04 / 342.30 = 1634.2 g of CO2
3177.6 * 184.28 / 342.30 = 1710.7 g of EtOH
3177.6 * -18.01 / 342.30 = -167.2 g of water lost
Thus after fermentation we have a solution containing 1710.7 g of EtOH and 18,006.4 - 167.2 = 17,839.2 g of water (ignoring any water evaporation during fermentation.) The total weight of the solution will be 1710.7 + 17,839.2 = 19,549.9 g. This solution will be 100% * 1710.7 g / 19,549.9 g = 8.75% EtOH by
weight (~10.9% ABV.) The solution has an SG of 0.9854, so the volume will be 19,549.9 g / (998.2 g/L * 0.9854) = 19.875 L.
So, we lost 20 - 19.875 = 0.125 L (125 ml or ~ 1/2 cup) of volume during fermentation (again ignoring any water or EtOH evaporation during fermentation.)
What about the CO2? A fermentation done at 68°F will have a residual carbonation level of 0.84 volumes. 1 volume is equal to 1.977 g/L of CO2, so we will have:
19.875 L * 0.84 * 1.977 g/L = 33.0 g of CO2 in solution
1601.2 g of CO2 will have bubbled out of the solution during fermentation. The volume effect of 33 g of CO2 in solution is unknown at this point, but should be small compared to the total volume.
Brew on