This software will allow you to calculate how much water is needed for the sparge and the mash. It also calculates the mash liquor temperature for an infusion mash. In the above example the desired mash temperature is 150 degrees. For a thickness of 1.33 quarts of water per pound of grain the mash water must be heated to 160.8 degrees before the grain is doughed in.
I've been stopping the sparge when the boiler is two gallons short of the target value. With about 22 lbs. of grain the final run-off from the mash tun yields the additional two gallons. Therefore my total sparge water requirement is about eight gallons. I use the left over hot sparge water for clean up.
One of these days I'll weigh the spent gains and calculate exactly how much water is retained per pound.