I'm trying to answer 2 questions:
- how much gas will be produced during fermentation
- what would the pressure be in a 5g corny if used as primary fermenter will NO VENTING
I tried to calculate this, but the number is absurdly low. What did I do wrong?
The first error is assuming equimolar production of ethanol and CO2. 1 gram of ethanol (1/48.07 = 20.80 mmol) corresponds to 0.9565 grams of CO2 (.9565/44 = 21.74 mmol). The 821 grams of EtOH OP estimated would correspond to 0.9565*821 = 785.3 grams of CO2. Not a huge error by any means. But the answer to the question "How much gas would be produced" depends on the amount of alcohol produced and in this case is 785 grams. This can be expressed in terms of a volume at any temperature and pressure you desire.
The next error is failure to consider the partition of CO2 between the headspace and beer volumes. The problem at this point can be posed as "I have 18 litres of beer and 1 litre of head space. The total CO2 is 783.3 grams. What is the pressure? The answer is 256 psig at 50 °F. This depends on the fact of having 783 grams of CO2 which in turn depends on the assumption that 821 grams of EtOH was produced. Clearly you aren't going to get 256 psig and that is, among other things like the keg rupturing, because yeast metabolism will be slowed as the pressure increases. You will not get 821 grams of EtOH.
I assume you are as or more interested in how one calculates such a result than the actual result.
Given a headspace volume, temperature and pressure it is easy to calculate the volume of a mole of CO2. The ideal gas law is close enough (cosidering the first virial coefficient changes the answer by 2 psi):
Vm=R*K/P where R = 0.08205 L-Atm/K-mol, K is the temperature in Kelvins
(K = °C + 273.15), P is the pressure in atmospheres (psig + 14.695)/14.695. Divide the headspace volume by Vm to get the moles of CO2 in the headspace and multiply by 44.01 to get the grams of CO2 in the headspace.
Now turn your attention to the beer. The volumes of CO2 dissolved in beer at Fahrenheit temperature T and gauge pressure P are, approximately
V = (P+14.695)*(0.01821+0.090115*EXP(-(T-32)/43.11))
Multiply this by the volume of the beer to get the dissolved volumes of CO2 at STP. At STP a mole of CO2 occupies 22.272 L so divide the product of beer volume and V as calculated above to get the moles in solution and multiply that to get the grams of dissolved CO2.
The assumption is that you would do an Excel spreadsheet into which you put temperature, pressure, headspace volume and beer volume and enter the formulas necessary to calculate the weights and the sum of the weights. It's now a simple matter of trying different pressures until you get the one that gives a total CO2 weight of 783. If you know how to use it the Solver will do this for you automatically.
The bottom line here is that 783 grams is a lot of CO2 ~ 409 liters at 50 °F and 1 atm. If you try to confine that in a 19L space the pressure is going to go up by a factor of about 409/19 = 21.5 i.e. you should expect a pressure increase to about 21.5 atmospheres. In fact because most of the gas dissolves in the beer the pressure is 'only' 18.4 atm but as noted you would never get that far.
-- 17.82 mole CO2 * (44.010 g/ mol) = 784 g CO2
You got about the correct mass of CO2
-- 784 g CO2 / (1.977 g/L) = 396 L CO2 (at 0 deg C)
And about the right volume at STP
-- "Confined to 1L headspace: P = 17.82 **8.314472 * 273.15 / 1L = 40470 Pa
-- 40470 Pa = 5 PSI
But you lose me here. In the first place it isn't confined to 1L but rather 1 L headspace and 18 L beer. If it were 1L the pressure would be 396 atm. Last time I saw the ** notation it was in FORTRAN code and that was a long time ago.