Wednesday, November 24, 2010

New text and file repository

Over on the right, under Resources, there is a link to a "Document Store". That's where I keep various bits of code and other texts. The TempLS material is there, for example. I had been keeping it on a location on drop.IO.

Steve Mosher warned me that drop.IO has been taken over by Facebook, and will be closing. I looked around, and discovered that there is a much better alternative. Google Sites allows users, free, to set up a site with 100 Mb of space, to which you can upload files, images, etc. It also offers a range of templates replete with gadgets.

So I have set one up. It's a bit of a work in progress. The templates are impressive, but none quite matched. I chose a project template, which has lots of facilities, but some not really appropriate management talk. I've tried to keep that to a minimum.

So if you go to the new Document store you'll see a home page, with some intro stuff (not much yet), and a pointer to a page of "Project Documents". This is the new repository. The Google facility allows me much more freedom in writing descriptive text (so I'll have to do it :().

I'll also use it to host images - I've set up a "Picture Gallery". There's no real reason to look at that, as it's just for images to link in to posts, but you can if you want. I had been using TinyPic, but I don't need to do that any more.

I'll also transfer to it ongoing items like the category index of posts, and the temperature tracking page. I'll also make an updated TempLS page and keep it there.

The links within past posts still point to drop.IO, and I probably won't fix many of them. But you can always use the link under resources.

One merit of the new scheme is that I can link to individual files.


Tuesday, November 23, 2010

Woody Guthrie Award - thanks, Science of Doom

A note to thank Science of Doom. I am very honoured that he has chosen this blog  as his successor,  with the privilege of passing on the Woody Guthrie Award. I was especially pleased because SoD's style of dispassionate informative blogging is what I have aspired to here. So thanks, Science of Doom. And thanks to readers, who keep this blog going.

I did a bit of googling to find the history of the award, which I have been aware of since it first came to Skeptical Science. I've been able to track it back a few generations, as far back as Ærchie's Archive, who passed it on to Honji's Harangues. From there it went to honestpoet at
Enough is Enough, and she nominated Greenfyre's.
 
This was an interesting change, from a succession of rather philosophical blogs to one with a science/climate focus.

Greenfyre's passed it to Dan's Wild Wild Science Journal, who then passed it to
Skeptical Science. They awarded it to Science of Doom and, well, here we are.

Unfortunately, I can't find a reference to the event on Ærchie's Archive, so I can't go back further. But the search took me to a lot of interesting blogs, of which Archie's is one. It's discursive, but with a focus on Perth landscapes and history. I like Perth a lot - I've lived there - and I think Archie gets it well. Currently active and recommended.

The award used to come with a little graphic;



which may have been more relevant in its earlier life cycle.

Anyway, it's now my job to pass it on. No need to rush there but thoughts would be welcome. Given its history, it seems ideas need not be restricted to the climate science community. I would have given a lot of thought to this excellent blog, but sadly, the owner retired a few months ago. I miss it.





Saturday, November 13, 2010

Condensation - the Eulerian View

In the previous post I analysed the effect of expansion in a cylinder on condensation. As the pressure reduces, of course, the volume increases. The key question was whether it increases more or less than if the air had been unsaturated.

This is supposed to help with what might happen in atmospheric uplift, as in a hurricane. The pressure reduces and the gas expands in the same way. If you focus on the moving air, in fluid mechanics that is the Lagrangian view.

It's better for intuition - the boundaries of the volume travel with the fluid, and by assumption in the atmosphere, heat and other species like water vapor travel with it too, and remain in the boundaries.. That is because diffusion over the large distances is relatively small, although thermal radiation could be an issue.

But there are problems when you want to think about the processes in relation to other things that are not moving with that fluid. Fixed boundaries are one issue - not so common in the atmosphere. But in the ongoing argument about Anastassia Makarieva's contraction theories (TaV1, JC and TaV2, Lucia1, Lucia2),  AM prefers the Eulerian frame, a fixed volume in space.

The good thing there is that you can assume steady conditions. At every point the velocity, temperature etc will remain steady, even though as you follow it in the flow, it changes. The bad thing is that the boundaries are no longer material boundaries, and you have to account for whatever is crossing it. Not so intuitive.

Scientists tend to talk Lagrangian to students, but Eulerian to their computers.

Here I'll take the Eulerian view of expansion and condensation.




A 1D (vertical) problem


In accounting for boundaries, it helps to have only two (upper and lower). I'll look at a 1 m thick slice, assuming zero horizontal gradients. The notation is generally as in the previous post. We'll say z goes from 0 to 1, and I'll suffix accordingly (but if suffix is missing, assume zero). So T,V,P, ρ are assumed known at z=0. The incoming air is saturated.

I'll also assume, as is conventional, hydrostatic pressure. So P1 =P0 -ρ g

Then each incoming packet of air changes according to the cylinder analysis, with this pressure increment:

T1 =T0 -ρ g dT/dP
where dT/dP = (T/P) DT/DP = (T/P) (1+c+c/b)/(3.5+b+b*c), b=L/(R*T), c = b*nw/n
In the previous post, n, nw were moles in a volume V. Here I'll take V=1, so they are molar densities.


nw1 =nw0 -ρ g dnw/dP
where dnw/dP = (nw/P) Dnw/DP = (nw/P) (1+c+c/b)/(3.5+b+b*c)

Density is calculated from dV. The mass change in the unit volume element Mw*dnw,  ( Mw = molar mass of water) so the density change is
d ρ /dP = Mw*dnw /dP + ρ/P DV/DP
= (Mw*nw /P *(b-3.5)+ ρ/P (2.5+b*c+2.5*c/b-c))/(3.5+c+b*c)

Velocity and precipitation reconciliation

The molar mass flux of dry air through z0 is    v0*Nd
The number of moles is conserved; in the notation of the previous post, Nd varies inversely as V, ie DNd/DP=-DV/DP.
So with v=1 m/s,
dv/dP=(v/P)Dv/DP = (v/P)DV/DP=(v/P)a4/a3
Velocity v increases with z.

The precipitation rate r moles/m3/s is
r=v dnw/dz= vρ g (nw/P) (1+c+c/b)/(3.5+b+b*c)

Results

Again the meaningful test is to compare saturated air with unsaturated air under the same conditions. With z in km:
dT/dz   dnw/dz   dρ/dz   dv/dz  
Dry   -9.75   0   -0.0937   0.0818  
Sat-4.151-0.147-0.11370.0969
The results are much as expected. dT/dz is the lapse rate. dnw/dz is numerically (withv=1) the precipitation rate in moles/km/m2/sec . 0.147 is equivalent to 9.5 mm/hr from a 1 km column - but remember the 1m/s velocity is arbitrary. The density reduces with height, but more rapidly for the saturated flow. And the velocity also increases more rapidly.

Interpretation

It is a steady flow. But also expanding. The upward velocity would have increased just because of the hydrostatic density gradient, but it increases more because of the condensation. This is due to the release of latent heat, which dominates the contraction due to mass loss.

The same expansion is seen in the density gradient (reducing faster). and the warming is seen in the well-known reduction of lapse rate with condensation.

Further note

 I mentioned in the previous post that the formula for DT/DP could be found, with slight modification, in the Phys Met notes of Dr Caballero. I realised then that it is just the formula for the saturated adiabatic lapse rate, which has a much longer history.

As explained in that earlier post, my form isn't quite the same. There is a discrepancy due to the mole concentration I made in the Ideal Gas Law. I've kept with it, because it does seem to be the irght thing to do.

R Code

 T=298.15
V=v=1
P=98131
R=8.314
N=P*V/(R*T)
Nw=0.03128*N 
Cv=20.85
Mw=0.018
Ma=0.02896
L=2304900*Mw
g=9.8
rho = N*Ma
 
b=L/R/T
c=b*Nw/N
a1=1+c+c/b
a2=b-3.5
a3=b*a1-a2
a4= -(2.5*a1+c*a2)
 
dp=c(0,0,0,0)
dp[1]=dTdP=(T/P)*(a1/a3)
dp[2]=dNwdP=(Nw/P)*(a2/a3)
dp[3]=drhodP  = (Mw*(Nw/P)*a2 - (rho/P)*a4)/a3
dp[4]=(v/P)*a4/a3
dz=-dp*rho*g*1000
# print(dp); print(c(a1,a2,a3,a4))
print(dz)
 

Saturday, November 6, 2010

Condensation and expansion

There has been much blog discussion of whether condensation of water in the atmosphere is accompanied by a volume expansion or contraction. Standard theory says expansion, but Anastassia Makarieva has been promoting a theory that winds are driven by contraction caused by condensation. There is discussion here and here. The paper (M10) is available and open for online discussion here.

M10 has a whole section devoted to demonstrating that a fixed adiabatic volume cannot undergo condensation. As I'll show, this is an unsurprising result. But the section arises from reviews of an earlier paper suggesting hurricanes were driven by condensation-induced contraction. Reviewers objected that latent heat release would outweigh the tendency to contract to to loss of water vapor volume. So there was no contraction to provide energy.

On the Air Vent threads, various experiments to study condensation/contraction were proposed involving air in bags and bottles, etc. I have been trying to explain how they lack the adiabatic expansion that causes cloud condensation. Bodies of air rise, and as they do so they expand, doing work and cooling. If they are saturated with water vapor, some of this condenses. Because the cooling is adiabatic, the latent heat is retained and slows down the cooling and condensation process. The result is that the air parcel becomes warmer than its surroundings (though cooler than it was originally) and so expands relative to nearby air.

Below the jump, I'll describe a stationary volume-change process with condensation, and calculate the expansion effect.



Consider a volume of saturated air held adiabatically in a chamber with a piston which can force an expansion. For definiteness, let's say that  V=25 m3 at T=300°K, containing n=1000 moles of air+water at P=100 kPa. Latent heat (of vap) L=45 kJ/mol. There are nw =36 moles of water vapor present.

As the piston moves, there are three governing equations:
Conservation of energy
1)      n cv dT + L dnw + P dV = 0

Ideal Gas Law:
2)     P dV + V dP = n R dT + dnw RT

Clausius-Clapeyron Equation
3)     RT2 dnw = L nw dT (see update)

[Update - a small error here. I've identified  dnw/nw with dpw/pw  But in fact
pw =p(nw/n) .and p is not constant. So it should be
3)    RT2 (dnw/nw + dp/p)= L dT
It makes a small difference - full update to come (7.47 am 9 Nov)
It's here (140 pm) - I've marked new in brown, and obsolete in grey]

I prefer to put these in non-dimensional form, using a notation Dy =1/y dy (y=T,P etc). That means that Dy is a proportional change in y. So:

Divide (1) by PV or nRT
4)     cv/R DT + (L*nw)/(R*T*n) Dnw + DV = 0


Divide (2) by PV or nRT
5)      - DT - nw/n Dnw + DP + DV = 0


Divide (3) by R*T2*nw
6)      - L/(R*T) DT + Dnw + DP = 0

Solving

There are three equations in the four variables (DT, Dnw, DP, DV). However, one of these, DP or DV, is specified (the amount the piston is moved).

If you set DV=0, then there is just one solution DT= Dnw=DP=0. In other words, no condensation - nothing can happen. That's what Sec 2 of M10 was about.

Fixing DP is most natural for atmospheric comparison, since P is a measure of altitude. Dividing the equations by DP gives the derivatives ( DT/DP, Dnw/DP, DV/DP). Remember these are proportional derivatives. If you change P by p%, then you change V by (DV/DP)*p %.

I did a first solution with nw=0. This is in effect the dry air case. The R code is below.

With the diatomic cv/R = 5/2, it gave, as expected,
  DT/DP=2/7=0.2857,    DV/DP=5/7= -0.714
That means that if P decreases by 1%, then the volume V increases by 0.71% and T decreases by 0.28%

Then I did the solution for the above case at 300 °K, 100 kPa. The answers were:
DT/DP=0.063,    Dnw/DP=1.14,      DV/DP=-0.896
DT/DP=0.106,    Dnw/DP=0.916,      DV/DP=-0.861

Added: Plot of % variation (dry and wet) of temp, volume and wv with varying P. Note that with expansion, P diminishes.

First observation - wet DT/DP is much smaller. Condensation is stabilizing the temperature, as you'd expect. And a 1% drop in P causes 0.916 1.14% of water vapor to precipitate.

But the answer I was looking for is the third. A 1% drop in P increases the volume by 0.861 0.896% - more than it does for dry air (0.714%). The condensation causes the volume to expand relative to non-condensing air.

Interpretation

This study was just of air in a confined space. But it can be applied to saturated air rising in parcels in the atmosphere. The dry lapse rate is the temperature gradient which is neutral for air moving without condensation (more here). So the moist air is cooling more slowly than the lapse rate as it rises, and is expanding relative to air on its level.

Update - more algebra

Equations 4-6 can be rewritten in even fewer non-dimensional parameters. I'll take the ratio cv/R = 5/2.

Then with b=L/(R*T), and c=(L*nw)/(n*R*T)

7)      2.5 DT + c Dnw + DV = 0
8)      - DT - (c/b) Dnw + DP + DV= 0
9)      -b DT + Dnw + DP = 0

Eqns 7-9 are linear homogeneous equations in the four variables: (DT, Dnw, DP, DV) The answer can be expressed in terms of a vector a=( a1,a2,a3,a4 ) and an arbitrary parameter h:
DT=a1h,  Dnw=a2h,  DP=a3h,  DV=a4h. 

Finding a is a matter of linear algebra (school algebra or determinants). I'll just state the result and verify:

a1 = 1 + c + c/b,  a2 = b - 3.5,  a3 = 3.5+c+b*c,  a4 = -(2.5+b*c+2.5*c/b-c)

Substitute in (7) with h=1 (h will cancel):
2.5*a1 + c * a2  + a4  =  2.5+2.5*c+2.5*c/b + c * b-3.5*c - 2.5 - b*c+-2.5*c/b+c  =  0
And (8): -a1 -(c/b)* a2 + a3 + a4  =  1- c-c/b  - c+3.5*c/b + 3.5 + c + b*c - 2.5 - b*c-2.5*c/b+c  =  0
And (9): -b*a1+ a2  =  -b-c-b*c + b- 3.5 + 3.5+c+b*c = 0

You can use this result to get any desired derivative, eg DV/DP = a4/a3
Remember again that D is proportional, so dV/dP = (V/P) a4/a3.

Update. I see that Eq 3.74 of Rodrigo Caballero's PhysMet lecture notes gives a version of DT/DP which is equivalent to (1+c)/(3.5+bc). He says this is an approximation (3.72). I think that is equivalent to omitting the last term in my Eq 2, which would indeed give this expression. However, I believe the inclusion of that term is more accurate.
 

Appendix - R code
V=25
T=300
N=1000
Nw=36   #0
P=100000
R=8.3
Cv=R*2.5
L=45000

LRT=L/R/T
m=matrix(c(Cv/R,-1,-LRT,  LRT*Nw/N, -Nw/N,1, 1,1,0, 0,1,1),3,4);

M=m[,c(1,2,4)]; rh= -m[,3];
ddV=solve(M,rh);    # D/DV volume derivatives


M=m[,c(1,2,3)]; rh= -m[,4];
ddP=solve(M,rh);    # D/DP pressure derivatives

print(ddV);  print(ddP);