Wednesday, March 9, 2011

Simulation Time

So far, we have measured simulation time in units of iterations. Today we relate iterations to time in seconds, and use this relationship to choose a heating rate better suited to a simulation of the Earth and the Sun.

Our simulation selects one block of four cells at random on each iteration. With thirty columns and fifteen rows in our array, a rising cell will find itself selected once in every hundred iterations. For circulation to occur, the rising cell must be one of the two lower cells in the block. Furthermore, the cell diagonally above it must be a falling cell. No more than half the cells are falling, so we see that a rising cell will move up by one row every four hundred iterations on average. A cell will take roughly six thousand iterations to rise from bottom to top.

The tropopause pressure in CC4 is 50 kPa, and the surface pressure is 100 kPa. Using the equation we presented in Atmospheric Pressure, we see our tropopause altitude is around 5 km. If one iteration corresponds to one second, cells will take six thousand seconds to rise five kilometers. Their average speed will be around 1 m/s. They will rise from the surface to the tropopause in one and a half hours. But if one iteration corresponds to ten seconds, rising cells will move at 0.1 m/s and take seventeen hours to reach the tropopause.

In Work by Circulation we presented an example circulation driven by a rising cell at 320 K and a falling cell at 300 K. This particular circulation generated 160 J of work for each kilogram of air in the rising cell. In our Planetary Greenhouse simulation, the average work produced by a single circulation is 60 J per kilogram of the rising cell. If this work turns into kinetic energy of the four rotating cells, each kilogram will receive 15 J. The cells will accelerate to 5 m/s. Our CC4 simulation assumes this kinetic energy is dissipated as viscous friction within the block. In that case, the average speed of the circulating cells will be less then their maximum possible speed, perhaps as low as 1 m/s. But the speed will certainly not be as low as 0.1 m/s.

We conclude that one iteration of our simulation is closer to one second of planetary time than it is to ten seconds. With one second per iteration, rising air will take roughly one and a half hours to travel from the surface to the tropopause. Falling air will take one and a half hours to descend.

As we showed in Solar Heat, the average power arriving from the sun per square meter of the Earth's surface is close to 350 W. Let's suppose the bottom cells of our simulation are warmed at an average rate of 350 W/m2. With top pressure 50 KPa, bottom pressure 100 kPa, and 15 rows of cells, each row represents a drop of 3.3 kPa. With gravity 10 N/kg, the mass of each row must be 330 kg/m2. The heat capacity of air at constant pressure is 1 kJ/kgK, so 350 W/m2 will cause a cell to warm at 0.001 K/s, or 3.6 K/hr.

Thus we see that Q_heating of 0.001 K represents the Sun's effect upon the surface of the Earth far better than the 0.01 K that we have been using in our experiments until now.

With Q_heating set to 0.001 K instead of 0.01 K, the heat flow through our cell array will be ten times lower. The heat flow will be ten times smaller when compared to the heat capacity of the cell array. It will take ten times as many iterations for the simulation to converge. We find that it still takes six thousand iterations for a cell to rise up through the array, but now it takes six million iterations to approach a new equilibrium. Six million iterations represents six million seconds, or roughly two months. This corresponds well to the pace of the Earth's seasons. The shortest day in Boston, for example, is in December. But the coldest weather occurs two months later.

We ran our CC4 simulation in Planetary Greenhouse mode and allowed the temperature profile to reach equilibrium for various values of mixing fraction. We present our results below. In the legend, M is mixing_fraction and Q is Q_heating. Our CC4 program allows us to save and load previously-converged cell arrays. With the help of saved arrays, we were able to obtain convergence within two million iterations in most cases.

As we discussed in Circulation and Mixing, allowing cells to mix as they circulate can increase the temperature drop from the bottom to the top of the array. This is indeed the case when Q = 0.01 K, which corresponds to Solar heating of 3.5 kW/m2, or ten times what we expect on Earth. But when we reduce Q to 0.001 K, mixing has the opposite effect. Michele's experiments show us that when Q = 0.001 K and M = 0.10, mixing alone is sufficient to transport all the heat through the array with a temperature drop of only 60 K. The temperature drop is less than that we would obtain without mixing. The temperature profile is, in Michele's words, hypo-adiabatic.

With M = 0.05, our simulation predicts a temperature of 297 K at the surface and 250 K at 6 km, which is very close to that of the Earth in middle latitudes. We observe steady circulation of cells from bottom to top.

When we increase M to 0.10, however, circulation slows down dramatically. If circulation slows down, mixing must slow down too, which means that our result for M = 0.10 presents us with an apparent contradiction. We see that mixing can occur only up to the point where it starts to slow down circulation. With Q = 0.001 K, we must have M ≤ 0.05. For M ≤ 0.05, the surface temperature is within one degree of its value for M = 0.00. Now that we have reduced Q to 0.001 K, it appears that we are better off running with the mixing turned off. We speed up execution, we avoid any self-contradictory mixing behavior, and we suffer no significant change to our atmospheric temperature profile.

PS. You can download the equilibrium state of the Planetary Greenhouse with M = 0.05 and Q = 0.001 K in PGH_M005_Q001.


  1. I hope to convince you that in the circulation of the four cells any job doesn't appear as for magic.

    ’’ I refer to the figure linked here ‘’

    The lower-left cell rises Δz1 and expands ΔV1 while its weight counteracts with the work WΔz1 and the external pressure contributes with the work A*Δp*Δz1 = V1Δp. The balance of the works gives ΔU1 = CvΔT1 = WΔz1 – V1Δp.

    The upper-right cell falls Δz2 and is compressed ΔV2 while its weight contributes with the work WΔz2 and the external pressure counteracts with the work A*Δp*Δz2 = V2Δp. The balance of the works gives ΔU2 = CvΔT2 = WΔz2 – V2Δp.

    The rising/falling cell has to respect the energy balance stating that each steady process is adiabatic, but also the momentum balance which states that the temperature T is linear with z. If the motion is uniform too then δT/δz = - g/Cp.

    Using the adiabatic condition for the processes you get ΔT1 > ΔT2 but you have to refer also to the momentum and then Δz1 > Δz2. What seems a surplus of expansion work done by the first cell is not available for the other cells because it is used by the same cell for to get higher.

    The cells with constant mass are not simply to handle because their different volumes and hence the different altitude of their center of mass.


  2. Dear Michele,

    Thanks for your comment and your diagram. I understand what you are saying, and I believe you are correct for the two cells you considered. I am glad you started this discussion because I have been thinking a lot about this problem recently.

    There are four cells in the rotation. You ignored two of them. The total work done by gravity will be the weight of the entire block of four cells multiplied by the amount by which the block moves down.

    Let Tji be the initial temperature of the cell in row j and column i. Let α be the scaling factor for pressure going from row j to row j+1. Let β be the scaling factor for temperature. Let's take zero altitude as the bottom surface of the block. The altitude of a cell is the altitude of its center of mass, which is half-way up its own height.

    The altitude of the hot cell on the bottom-left is mRT00/2p, where m is the mass per square meter of bottom surface, p is the pressure in the bottom row, and R is the gas constant for 1 kg. Let mR/p = k for brevity, so we write the altitude of the hot cell as kT00/2. The altitude of the bottom-right cell is kT01/2.

    The top-left cell is at a lower pressure, and it sits upon the bottom-left cell. Its altitude is k(T00+T10/2α). You see that the entire height of the hot cell goes into this equation. In the same way, the cold cell on the top-right is at k(T01+T11/2α).

    The altitude of the entire block is at:

    h1 = k(3T00/2+T10/2α+3T01/2+T11/2α)/4

    Now we rotate the cells clockwise. We must account for the changing temperature and pressure of the cells, using α and β. The new altitude of the block is:

    h2 = k(3T01/2+T00β/2α+3T11/2β+T10/2α)/4

    Thus h2−h1 =

    The terms in T01 and T10 cancel, so the temperature of the cells that move sideways is unimportant. But their mass is important. One of them drops down, and this drop dominates the movement of the block.

    With a few more lines, we conclude that the block drops down only if

    T00/T11 > (3α/β−1)/(3α−β).

    You will find the above calculations in the circulate routine of CC4.

    It is true, as you say, that the rising cell moves up more than the falling cell moves down. But the cell you ignored moves down by even more than this difference, so the net movement of the center of mass is downwards. Instead of there being work required by gravity, we in fact have work available from gravity.

    I conclude that there are two sources of work for circulation: gravity and expansion. In water, only gravity will apply. But in air, we have both.

    The problem with the gravitational work is that it takes place outside our block as well. There are cells above the block that must be raised and lowered during the rotation. Furthermore, when we heat a cell at the bottom, it must raise the cells above. Once we reach equilibrium, however, the altitude of the rows remains constant, so the sum of all the gravitational work will be zero.

    But there will always be an excess of work from expanding gas. This excess occurs every time we circulated cells and only when we circulated cells. It is always positive. This is the work that powers convection at equilibrium.

    The simulation confirms my conclusion. When we account for the work done by expanding gas, no more heat is lost from the simulation. The simulation ignores gravitational work, and there is no heat loss at equilibrium.

    I look forward to hearing what you think of my argument.

    Yours, Kevan

  3. I try again to clear up my thought about T = T(z).
    Using the superposition principle we can split up what occurs to the cell, which has at the beginning the thermodynamic properties P0, V0 and T0, into the following steps.
    1) The cell is at rest, the temperature becomes T1 and the volume stays constant. There is P1/P0 = T1/T0 and U1 – U0 = Cv(T1 – T0).
    2) The cell (still at rest) expands adiabatically working on the surroundings and the pressure comes back to P0. There is T2/T1 = (P0/P1)^R/Cp < 1 and U2 – U1 = Cv(T2 – T1).
    3) If we would bring back the cell to the initial state we had to subtract isobarically the heat Cp(T2 – T0). The cell, now free to move, rises as a weather balloon filled with warm air. The external and internal pressures are always identical and decrease as the cell climbs, the upward push on the cell decreases and hence its density increases, the temperature decreases. What a strange transformation! It is a compression looking at the volume and an expansion viewing the pressure and the temperature.

    That’s because we are taking into account only the work due to varying volume δW = - PdV and missing the work done on the cell at constant volume by the buoyancy, i.e. δW’ = – gdz - VdP.
    Then the first law of thermodynamics becomes (M is the mass of the cell) MCvdT = δW + δW ‘ = - PdV– Mgdz - VdP and this gives CpdT = - gdz . We have now Cp(T3 – T2) = - g Δz.
    The conservation of energy of the cell requires CvT1 must be equal to CvT3 + g Δz and this is verified. There is Cp(T3 – T2) = Cv(T3 – T1) = g Δz. The difference R(T3 – T1) is the energy used by the cell for to do the work on the surroundings which increases its energy.

    Your group of four cells isn’t too simple in its handing.
    If the cells of the same row have the same height and those of the same column have the same base then the cells are in equilibrium as there are not gradient of pressure both vertical and horizontal. If the height of the lower-left cell increases and the bases of the cells don’t vary then the vertical faces are not yet in equilibrium because the arising horizontal gradient of pressure that will compress all the remaining three cells, and this will compress the others and so on until the top of the column.
    How is it possible to simulate this happening? I don’t know. At least with a two-dimensional analysis using the equations of continuity, momentum, energy of the thermo-gas-dynamics. But is it worth? Probably there exists some software that yet does it.


  4. Dear Michele,

    You say, "The external and internal pressures are always identical and decrease as the cell climbs." You are right, but I'd like to point out that the reason you are right is because of viscosity.

    Let's assume a perfect balloon: there is no pressure difference across its surface. Consider a point in the surface at the top of the balloon. We descend through the inside of the balloon to the bottom and the pressure increases by hρb, where h is the height of the balloon and ρb is the density inside the balloon.

    We descend through the outside of the balloon to the same point just outside the bottom surface, and the pressure has increased by hρa, where ρa is the density outside the balloon. If ρa > ρb we see that the pressure inside the balloon at the bottom surface is less than the pressure outside. But we assumed a perfect balloon, so we have arrived at a contradiction.

    The balloon accelerates upwards. It does so until it reaches its terminal velocity, as dictated by viscosity. At this point, the pressure in the air underneath the balloon drops, until it is equal to the pressure inside the balloon.

    Thus viscosity plays an essential role in the behavior of balloons. Without viscosity, the balloon would accelerate all the way up through the atmosphere.

    You say, "What a strange transformation!" and I agree with you. The balloon and the air it travels through are getting less dense, but the balloon, being hotter, is always less dense than the air around it. I believe we have this phenomenon simulated well in our program.

    When we simulate a block of cells rotating, we don't have to assume that the bottom of the block is flat. We could allow one column to be slightly higher than the other. Buoyancy would still rotate the cells in the same way. So I don't see any problem with our arrangement.

    I have hesitated to use the concept of "enthalpy" in my posts. But I think you will be happy with the following argument, as a summary of your case for T=T(z). We have no heat passing in and out of the cells, so their enthalpy is constant.

    For slow-moving gas we have:

    H = CvT + pV + gz = CpT + gz

    but ΔH = 0 ⇒ T = −gz/Cp

    During circulation, each cell moves at constant enthalpy, but it's velocity is significant, which means viscosity must be significant too, because any time a balloon moves by buoyancy, it will accelerate to its terminal velocity.

    I have been calculating the work done by the center of mass of the block when it descends. I have been calculating the excess work available from expansion. (Well, the simulation has been calculating.) They are the same. I don't understand why. Are they two measurements of the same process? I will put up a post about it now, and look forward to your comments.

    Yours, Kevan

    PS. I hope you like my ⇒ symbol (& rArr;)