Watch this space. Imma write a epic response that will leave you amazed and enthused

(or dazed and confused

, or just

*whatever ...* )

Stay tuned

Brew on

============================================================================

Ok, you've waited long enough, here is my analysis of the OP's questions. You be the judge, is it epic or not? Worth the wait, or a big let down?

Pull up your waders, it's gonna get deep here. You might want to take this on while drinking coffee rather than beer.

============================================================================

We all know fermentation produces 100% pure CO2 gas -- wouldn't it be great to use it for purging a keg without pushing water out first?

Others have shown smart things like purging a serving keg with a fermenting keg.

I know there's a fixed relationship of CO2 production to sugar consumption, but I imagine that a continuous flow into a keg has a different diffusion dynamic than fill/purge -- and that's beyond me.

So I am looking for two things here:

1) A scientific way to determine how much pure CO2 is necessary to "wash out" a volume containing air, and

2) An easy way to determine how much CO2 will be produced by a given volume of wort at a given gravity, assuming a specific apparent attenuation.

I think once number 1 is determined, a chart or formula could be created to make number 2 a useful thing.

And there would need to be some assumptions like flowing gas in through the "out" dip tube and venting through an airlock on the "in" dip tube.

Has anyone worked on this?

Let's break this down into manageable pieces, and then look at them one at a time.

**First question: Does the continuous flow of CO2 from the fermenter create any different dilution kinetics than the typical multiple cycles of pressurize then vent?**
When we pressurize the headspace of a keg we produce a burst of CO2 gas originating at the gas in tube. This burst creates turbulence in the headspace which very effectively mixes the starting headspace gas and the added CO2. We can safely assume that the gases are well mixed prior to the vent cycle. This means we can use static, or equilibrium, math to determine the amount of dilution. We want to know solute concentration in a solution when additional diluent is added to a solution. In our case the solution is a gas solution, the solute is oxygen (O2), and the diluent is CO2. For one dilution (purge) cycle, the change in solute concentration is:

New_Conc = Prev_Conc * Starting_Amount / (Starting_Amount + Diluent_Amount)

When working with gases in fixed volume vessels, the "amount" of gas is proportional to the absolute pressure (psia), and absolute pressure equals gauge pressure (psig) plus atmospheric pressure (14.695 psia at sea level.) This follows from the universal gas law: PV = nRT. Thus the original "amount" of gas is 14.7 psia, and the diluent amount of gas is the pressure that we add to the keg, so the dilution per cycle becomes:

New_O2_Conc = Prev_O2_Conc * 14.7 psia / (14.7 psia + Purge_Pressure)

After we pressurize for the purge, we still have the same amount of O2 in the headspace that we started with, but the concentration is lower. Once we vent the headspace, the pressure drops back to 14.7 psia, and we have less total gas than we had before. Venting doesn't change the O2 concentration in the headspace, but since it does reduce the total amount of gas in the headspace, the amount of O2 goes down as well. The pressurize part of the purge cycle reduces the O2 concentration in the gas mix, and the venting then reduces the O2 amount. The effect of additional purge cycles is multiplicative, so the formula for multiple purge cycles is:

Final_O2_Conc = Orig_O2_Conc * (14.7 / (14.7 + Purge_Pressure)) ^ N

Where N = number of purge cycles

The O2 concentration in air is 21% or 210,000 ppm. If we assume that the keg headspace starts out as air, then we can calculate and plot the resultant headspace O2 concentration for various numbers of purge cycles at different pressures.

So, what happens if instead of doing pressurize/vent cycles, we flow CO2 into a vessel that originally contains air? Does the flow improve the dilution and removal efficiency of O2 compared to the cyclic process? We can argue that if the CO2 inflow is fast enough that CO2 comes in faster than it can mix with the air, then it could form a sort of gas piston that would push air ahead of it towards the vent, and that this would push out more O2 per volume of CO2 than if complete mixing of incoming CO2 and existing gas occurred (as it does in the pressurize/vent case.)

The best case for non-mixing of CO2 and headspace would be if there were absolutely no internal "air" currents, such that the only mixing of CO2 with headspace gas would be via diffusion. So the question comes down to: Is the linear CO2 flow rate faster than the diffusion velocity of CO2 in air? If the CO2 flow rate were much faster than diffusion, then mixing would be limited, and continuous flow would be more efficient than purge/vent. If CO2 flow rate were much slower than diffusion, then gases would be mostly mixed, and continuous flow would not be any more efficient than pressurize/vent. If the flow rate and diffusion rates were of the same order of magnitude, then there would be significant, but not complete, mixing, making this the most complex scenario to analyze.

To start we need to get an estimate of the diffusion velocity of CO2 in air. If we limit our analysis to one dimensional flow (say from bottom to top of a keg, uniform velocity across the width), things will be much simpler, but still valid. Fick's first law of diffusion is (ref:

Diffusion - Wikipedia):

Flux = -D * (𝚫Conc / 𝚫Dist)

Where Flux is in mass/area-time,

D is the diffusion coefficient, and

𝚫Conc / 𝚫Dist is the concentration gradient

If we divide Flux [mass/area-time] by density [mass/volume] we get linear velocity [dist/time] which is what we are looking for.

The diffusion coefficient for CO2 in air is about 0.15 cm^2/sec (ref:

Oxygen Diffusion/Air - Cornell Composting) Now if we make some assumptions about gradients we might encounter, we can estimate a linear CO2 flow rate due to diffusion. We will use approximate numbers for simplicity, since we are only looking for order of magnitude estimates of velocity.

A corny keg has a volume of about 20 L or 20,000 cm^3, and a height of about 55 cm, leaving a cross sectional area of about 20,000 cm^3 / 55 cm = 364 cm^2. The density of CO2 at STP is about 2 g/L or 0.002 g/cm^3 (ref:

Gases - Densities.) If we assume 2.5 cm of pure CO2 at the bottom of the keg, and 2.5 cm of air at the top of the keg, and a uniform concentration gradient from the bottom to the top, the CO2 gradient becomes:

𝚫Conc / 𝚫Dist = (0 - 0.002 g/cm^3) / 50 cm = -4.0e-5 g/cm^4

The CO2 flux becomes:

Flux = -D * (𝚫Conc / 𝚫Dist) = -0.15 cm^2/sec * (-4.0e-5 g/cm^4) = 6.0e-6 g/cm^2-sec

And finally the linear velocity of CO2 due to diffusion is:

CO2_Diffusion_Velosity = CO2_Flux / CO2_Density = 6.0e-6 g/cm^2-sec / 0.002 g/cm^3 = 0.003 cm/sec

Next we need to determine the linear flow velocity of CO2 being fed through a keg from an active fermentation.

The reaction for fermentation of maltose is:

Maltose + H2O --> 2 Dextrose --> 4 Ethanol + 4 CO2

Maltose has a molecular weight of 342.30 g/mol and CO2 has a molecular weight of 44.01 g/mol, so each gram of maltose fermented generates 4 * 44.01 / 342.3 = 0.5143 gram of CO2. So, if we determine how much sugar we ferment over what period of time, we can calculate how much CO2 we created and calculate an average flow rate over the cross section of a keg.

Let's work an example assuming 20 L of wort with an OG of 1.050 that achieves 80% apparent attenuation over a four day fermentation. First we have to determine how much sugar we started with. An SG of 1.050 is equivalent to 12.39°Plato, or 12.39% sugar by weight. To convert SG to plato use the following formula (ref:

Brix - Wikipedia):

°Plato = -616.868 + 1111.14 * SG - 630.272 * SG^2 + 135.9975 * SG^3 @ 20°C

Water at 20°C has a density of 0.9982 kg/L, so the weight of 20 L of wort @ 1.050 is:

20 L * 1.050 * 0.9982 kg/L = 20.96 kg

This wort is 12.39% sugar by weight, so the weight of sugar is 2.597 kg. At 80% apparent attenuation, this beer would have an FG of 1.010, or 2.561°Plato. Since the presence of alcohol affects the SG the actual attenuation of the beer is lower (the final °Plato is higher), we must correct the final °Plato using the Balling approximation (ref:

https://byo.com/hops/item/408-calcu...ion-extract-and-calories-advanced-homebrewing):

Real_Final_°P = Apparent_Final_°P * 0.8114 + Original_°P * 0.1886

And, plugging in the numbers for our example:

Real_Final_°P = 2.561 * 0.8114 + 12.39 * 0.1886 = 4.415°P

Thus the finished beer contains 4.415% by weight of sugar, which works out to:

Final_Sugar_Weight = 20 L * 1.010 * 0.9982 kg/L * 0.04415 = 0.890 kg

The total sugar fermented works out to:

Fermented_Sugar_Weight = 2.597 kg - 0.890 kg = 1.707 kg

And the total weight of CO2 created works out to:

CO2_Weight_Created = 1.707 kg_Maltose * 0.5143 kg_CO2/kg_Maltose = 0.878 kg or 878 g of CO2

Since CO2 has a density of about 2 g/L, we created about 439 L or 439,000 cm^3 of CO2.

If we push our CO2 through the keg at a constant rate over a four day fermentation, the flow rate of the CO2 over the 364 cm^2 cross section of the keg works out to:

CO2_Velocity = 439000 cm^3 / (4 days * 24 hr/day * 3600 sec/hr * 364 cm^2) = 0.0035 cm/sec

Damn, that works out almost the same as our diffusion velocity of 0.003 cm/sec. So, we are in the complex, hard (i.e. infeasible) to analyze regime of relative flow rates. So, what do we do now? Well, we punt, and do the worst case analysis which would assume that we get no O2 removal assist from the sweeping action of the bulk CO2 flow. As a result of doing this our residual O2 levels will be less than we calculate, so we will have a built in safety factor.

So, the answer to our first question is: Yes, the bulk CO2 flow probably helps sweep out more O2 than do simple pressurize/vent cycles, but the analysis is too difficult, so we'll just ignore the flow sweep effect, and end up with a pessimistic estimate of our final purged keg O2 levels (i.e. things will actually be better than the calculations show.)

**Second question: What's the worst case O2 levels left in a keg purged with the output of an active fermentation?**
So, just how do we attack a continuous slow purge flow analytically? Assume a tube runs from the fermenter to the keg liquid post, and an airlock is fitted to the keg gas post. Then every time the airlock bubbles you lose a small volume of the current gas mix (which we are assuming is homogeneous) from the keg and fermenter headspace. Let's call this volume "𝚫V", and the total volume of the fermenter headspace, keg, tube, etc. "V". Furthermore, let's call the current concentration of O2 in V "C". We then have the following:

Total O2 in V before bubble = C * V

O2 lost to bubble = C * 𝚫V

Total O2 in V after bubble = C (V - 𝚫V)

Concentration of O2 in V after bubble = C * (V - 𝚫V) / V

If C[0] is the concentration of O2 initially, then after "N" bubbles, the current concentration of O2 is:

C = C[0] * ((V - 𝚫V) / V)^N

For V = 25 L and 𝚫V = 0.0001 L (0.1 mL), (V - 𝚫V) / V = 0.9999960. We're not getting much purging action per bubble; this doesn't look very promising yet.

So, where will we end up at the end of the example fermentation above? Well, we generate 439 L of CO2 from fermentation, and if we divide that into 0.0001 L bubbles, we produce a total of 4,390,000 bubbles. If we plug that into our formula above, and start with 210,000 ppm of O2 in V, then we have:

Final O2 Conc = 210000 ppm * ((25 L - 0.0001 L) / 25 L)^4390000 = 0.005 ppm

Believe it or not, we reduce the O2 concentration from 21% by volume to

**5 parts per billion** by volume! :smack:

Talk about the power of compounding!

We can only conclude that

** using the output of a reasonable size fermentation can very effectively purge a keg of O2.**
Coming next, the spreadsheet to allow you to do your own calculations.

Brew on