The CC3 program we presented in Planetary Greenhouse Simulation ignores the work done by cell circulation. Today we show how this omission caused the top cells to converge to a temperature 10 K lower than we expected. (Thanks to Michele for all his help in the comments.)
With Q_heating at 0.01 K, our simulation heats each cell in the bottom row by 0.01 K per iteration. With T_balance at 250 K each cell in the top row cools by 0.01 K per iteration. Our simulation assumes an ideal gas, so the heat required to warm or cool a cell by 0.01 K is always the same. At equilibrium, the heat entering must be equal to the heat leaving. We expect the top row converge to 250 K.
But the top row of CC3 converged to only 240 K. At 240 K, each top cell cools by only 0.0085 K per iteration. With circulation turned off, however, and only mixing to transport heat, the top row of CC3 did converge to exactly 250 K. We concluded that something was amiss with our circulation routine: it was making heat disappear.
In Work by Convection we showed how the expansion of warm, rising air does more work than is required to compress cool, falling air. The excess work manifests itself immediately as an upward force on the rising air. We could harness this force with a wind turbine. Otherwise the rising air will accelerate into a turbulent flow. Over time, viscous friction will transform this kinetic energy into heat. We discussed this phenomenon in Dissipation by Convection, and concluded that work by convection is what powers storms and winds.
Suppose we have a block of four cells in our simulation, at the bottom of the cell array. The lower-left cell is at 320 K while the upper-right is at 300 K. We rotate the block clockwise. The lower-left cell rises. Its pressure drops by 3.3 kPa, this being the weight per square meter of a single cell in CC3. If the cell expands adiabatically, its final temperature will be 320 K × 0.9903 = 316.90 K. Meanwhile, the upper-right cell falls. Its pressure rises by 3.3 kPa. Its final temperature will be 300 K ÷ 0.9903 = 302.94 K. One cell cooled by 3.10 K while the other warmed by 2.94 K. The two remaining cells, which do not change pressure, neither warm nor cool.
Both cells have the same mass, and the ideal gas inside has constant specific heat capacity Cp = 1.003 kJ/kg. One cell lost 3.10 kJ/kg while the other gained 2.94 kJ/kg. The difference is 160 J/kg. This 160 J/kg is the work done by the circulation. We did not account for this work in CC3. Each time a block rotated, the work by circulation disappeared.
Our CC4 program provides several new features. You can save the array temperatures to a text file, and load them also. You can track the movements and temperature of marked cells with the Tracking option. Within the code, we have greatly expanded the explanatory comments and we have simplified some of the routines and global variables to make future enhancements easier. But most important, CC4 accounts for the work done by circulation, as you can see for yourself in the circulate routine. The Viscosity option indicates whether or not we account for the dissipation of work by viscosity.
When CC4 rotates four cells, it calculate the work available just as we did above. We assume this work goes into accelerating the air within the cells and ends up dissipating as viscous friction within the four cells. The simulation adds the viscous heat to the four cells equally. The following graph shows the temperature profiles we obtained from CC4 after a million iterations for various values of mixing fraction (M) and heating rate (Q). Click on the graph for better resolution.
The top row converges to 250 K in each case. With no mixing, the bottom row is 50-K warmer than the top. With mixing fraction 0.1, the bottom is 58 K warmer than the top. With mixing fraction 0.4, it is 70 K warmer. The effect of mixing is almost exactly the same as it was for CC3. Also in the graph, you can see the profile that results when we turn off the circulation (NC) but set mixing fraction to 1.0. Heat is transported by mixing alone and the bottom is 62 K warmer than the top.
We conclude that the incorrect convergence of CC3 was indeed the result of our ignoring work by circulation. Indeed, we can obtain the CC3 results with CC4 simply by turning off CC4's viscous friction adjustment.