This is part four of a four part guest post by ‘Lucy Skywalker’.
Graeff’s experiments and 2LoD: Replication and Implications
Lucy Skywalker recaps: In Part One I described my visit to Graeff’s seminar. In Part Two I described some of his experiments in detail. In Part Three I showed how he developed the backing theory. Finally in Part Four I now consider the implications of this work, and plans for replicating the experiments. Replication is of crucial importance both to Climate Science in particular, and Science in general; without it, no theory is sacrosanct.
Here is a replication of one of Graeff’s experiments, assembled by him and ready to go. This particular experiment seems to be simpler in its results than the experiments we’ve looked at. But first, I want to think about implications of his work, to gauge where we want to pitch in.
IMPLICATIONS OF GRAEFF’S WORK
Graeff has demonstrated that a modification of the full statement for the Second Law is needed, and that this is possible without contravening the essence of the Second Law. One place where his modification is clearly of importance is Climate Science.

Atmospheric temperature drops on average about 7°C for every kilometre altitude gained, with variations depending on humidity and other factors. This is the adiabatic lapse rate which is very familiar to meteorologists and airplane pilots. Yet there is no theoretical basis that includes the molecular effect of gravity in the way Graeff shows must be at work – as far as I am aware. Now we suddenly have a very beautiful, very simple and very satisfying explanation for the adiabatic lapse rate, namely gravity on individual molecules, OFFSET more or less by convection to produce a dynamic and somewhat unstable equilibrium.
The following is my fuller explanation, which I hope others can improve:
By gravity, gas molecules fall and gain kinetic energy which is warmth. But this increased kinetic energy causes them to repel each other more actively and the gas will either expand-and-rise, or warm. We have a continual balancing-act between what individual molecules do in microscopic response to gravity (fall and get warmer) and what groups of free molecules can do all together – ie convect (expand and rise as a parcel, gaining momentum as wind but cooling due to both expansion and loss of gravitational kinetic energy). The very existence of the adiabatic lapse rate (a.l.r.) strongly suggests the presence of a gravitational temperature gradient T(Gr). It appears that T(Gr) (-0.07K/m = 70°C/km) is about nine-tenths offset by convection in the free atmosphere to produced the familiar adiabatic lapse rate of around 7°C/km – and a habitable planet. This is unfamiliar, so it feels tricky at first. One has to imagine single molecules under gravity, and at the same time, parcels of molecules able to have a net collective action ie convection. In the free atmosphere, convection nearly overcomes T(Gr), but not quite, and the a.l.r. is the result. But in the far denser oceans, convection wins over T(Gr) so cool water being heavier sinks. If there were convection impedance, warmth would increase with depth – as happens in the solid earth.The convection needed to balance T(Gr) in air is scarcely noticed on this planet. But the sun shining through clear air to warm Earth’s surfaces creates noticeable convection currents which, again, undo most of the warming.The true greenhouse effect occurs in greenhouses where convection is impeded.

I suspect that early meteorologists may have understood or intuited all this – it is not far-removed from common-sense. There is indeed sound evidence for the “greenhouse gas” properties of substances like CO2, O3 and CH4: we can see the evidence for ozone in the diagram above – but the ozone effect at least seems to be insitu, not projected down. Yet the IPCC claim a mere 33-degree greenhouse effect. This contradicts common-sense and the ozone effect, and when we look at the 70 degrees temperature difference between Earth’s tropopause and Earth’s surface; it is even further from explaining the 100-odd degrees temperature difference between the lunar surface temperature (measured now by Diviner) and the Earth surface temperature.
The gravity effect, as theorized by Graeff, can explain this large difference with no trouble at all (gravitational temp. gradient, minus local convection, equals local adiabatic lapse rate). It can explain the warmth in places below sea level, and down deep mines. Graeff’s theory also makes sense of the violent atmosphere on Jupiter and the very high temperatures of Venus’ surface and the interior of Jupiter. It starts to explain why our own planet is extremely hot at the core yet temperate at the surface. I have found nothing in the solar system that Graeff’s theory does not start to explain.
Graeff’s theory remedies a huge missing link.
HOW TO ALLOW FOR OUR HUMAN REACTIONS?
People have strong reactions to challenges to familiar ways of thinking. Some people will go to great lengths to stay in denial of evidence, rather than look at something that requires them to consider changing their thinking and their belief system, maybe risk losing grants, status, obsessions, or credibility. What an embarrassment if one’s lifelong “expertise” might not look so great any more. We’ve seen the whole of orthodox Climate Science close ranks and do this to skeptics, in spades.
In Graeff’s case, it is not only “warmists” who may have such a reaction. It is “climate skeptics” as well. Graeff’s theory not only challenges one of the most sacrosanct of all the laws of science, it also gives strong credence to other challengers like Nikolov and Zeller.
OK, we have to ask questions. Surely Graeff’s challenge would have been seen and accepted at the time of Maxwell, if it was good science?? Actually there was one good scientist, Loschmidt, who did dispute Maxwell. The really extraordinary thing is that until Graeff, nobody had checked Loschmidt’s challenge to Maxwell’s belief (and Gibbs’ mathematical theory) by practical experimentation.
REPLICATION OF EXPERIMENTS
Clearly we have to do very thorough checking, with replication of experiments. But we can save ourselves anxiety by remembering that only a few years back, Graeff’s experiments at laboratory scale would have yielded temperatures too small and too fluctuating to measure. We didn’t have suitable materials, or precision thermocouples and thermistors, or the computer power to record long sequences. But Graeff has developed sufficient methodology, and has shown what accuracy and consistency to expect, and how to wring statistically significant results out of fluctuating data, so that we can experiment and get valid results. The graphs below are a reminder from his water experiment. They show (1) how he wrung significance from the subtle effect of gradient fluctuations (thermocouples n 1-8, fine scale to LHS) lagging temperature rates of change (thermistors 9-14 – larger scale to RHS),
and how he used those temperature gradient fluctuations (thermocouples) plotted against extermal temperature changes (thermistors) to obtain a very exact reading for the temperature gradient when the external conditions are not changing (point where change per hour = zero).
NB: the thermistor readings above, while clearly accurate in showing change (they clearly move in step) are not so accurate in absolute terms. Therefore it is neither clear nor necessary to know which lines represent which, between 9 and 14.
We will still have to deal with challenges rooted in emotional denial. We can expect a lot of repetition and a great show of apparently relevant knowledge that may be valid as claimed, though it is more likely to be straw men etc. This can be tiring and depressing. Scientist have even committed suicide following such responses, even when their work has been correct and accepted years, decades or even centuries later.
But the other side of the challenges is eventually a very strong certainty. There is no way Science can escape dealing with emotional reactions. Rather, it is surely far better scientific practice to acknowledge human nature, and by acknowledgement, develop ways to deal with it. This is a big challenge to Science today – how to handle so-called “subjective” factors that Science rightly excluded early on, that are now kicking back so hard as to make corrupt nonsense of whole branches of Science.
At the simplest level, we can deal with this issue by simply becoming aware of what’s happening, without judgement, and preferably with compassion, whenever we see human frailty. Blogs can be brilliant places for developing this higher part of our human nature. Some awaken more quickly than others. But we are all on the journey.
At the end of all this, there is the excitement of real scientific discovery. Here is something important, right under our noses.
WHAT CAN WE DO NEXT?
I want to see Graeff’s work replicated in ways people can trust. I believe this is crucial at all levels. Without basic replication, people will reasonably say that Graeff could be mistaken (though I personally have no doubts). Replication is thus the key to:
- Put right a flaw in a very basic and very important law of physics
- Accept that even the Second Law can still have amazingly “obvious” flaws
- Open up possibilities regarding alternative energy production – possibilities that may have been prematurely excluded
- Help restore Climate Science to a proper scientific footing – and stimulate reform therein
- Open the way to a more holistic approach to Science altogether – we ignore “subjective” factors at our peril.
My latest news is that Graeff is actually working right now with a professor at an American University who is hoping to replicate his experiments. This is the first time anyone has actually chosen to replicate him, and collaborate. Professor Sheehan has certainly taken a warm and perceptive interest, but has not undertaken replication. A Japanese professor set up an experiment, but using a centrifuge without enough controls to be able to measure a true gravitational effect as Graeff has done. Lack of replication is not for want of Graeff trying to interest the universities that should be doing this work…
I regard this US development as of crucial importance. If Graeff’s work is now going to be replicated in proper fashion, and written up so as to be able to achieve at least the first two points above, I shall feel that my involvement in direct replication is no longer needed. However, we are not yet at this point. And I do not know how many of my other points the professor may be open to. So there may still be work for us to do, particularly to help this work to be grasped and honoured by Climate Science.
If nothing comes of the US development, then I will still need to start with replication – in which case, the questions are:
- Building a team – who wants to become involved? How can we build a good team? How about a trip to Graeff for this? Etc… I am willing to be a first contact point.
- Location – should we start where I live and where there are already many others interested in parts of science that orthodoxy will not examine? Does Tallbloke want to take on this project where he lives? Can we find a friendly college laboratory? Etc…
- Details: basic materials, sensitive equipment, skills, premises? How to find somewhere that maintains a constant temperature like Graeff’s thermostatically-controlled cellar? Do we simply collect scrap insulation / metal sleeves / etc or do we have money to go for “the best”? How much hands-on knowledge do we need? Can someone handle datalogger setup, calibration, and conversion to Excel on a PC? What can Graeff advise out of a lifetime of engineering? Etc…
- Communication: getting the word out to the professionals who should be doing this work – do we want to aim to produce a paper for peer-review? should we include Sheehan and Graeff and others? at what point do we step back with “mission accomplished” ?
I am hoping to visit Graeff again this year, perhaps with a small group of people who are interested like myself. I think that such a visit would make a huge difference. And it may be now or never, since he is 84 – and it would be a great loss to all of us if we miss this opportunity.
Prepared for the web from documents supplied by Lucy Skywalker.
TNC.










my mistake, I forgot to update the source when I updated the jar
http://www.filedropper.com/gas20120725_3
here is the latest source
the latest source includes this line:
// System.out.println(“off screen collision “
ferd:
“here is the latest source”
Great! All wall collisions are now exactly correct, all times are exact according to Newton’s uniformly accelerated motion equations, and particles sent on their way correctly. Nicely done, no further improvement possible.
That is for the general particle-wall impacts, but the next worry is when a particle is pushed out of bounds during a particle-particle collision. I fear as you notch up the density near the lower boundary that this is the next thing that could mess up the solution. Less clear what to do about that, I’ll give it a look.
I’ve made this change to the time slice.
int inc = (int) (sysTime-lastTime);
//dt *= inc/8.;
correction: the change to the time slice above caused the energy to drift slowly. change removed.
br1 says:
July 25, 2012 at 5:30 pm
I fear as you notch up the density near the lower boundary that this is the next thing that could mess up the solution. Less clear what to do about that, I’ll give it a look.
===========
I also struggled with that. In the end I added code to check for any energy loss/gain and automatically reduce the time slice until it stops or the time slice cannot go any lower without hitting zero.
“By the way, I’ve sent Q. Daniels the thermal walls implementation. There is a fan implemented also, but that will take another refinement before being robust.”
I’ve now sent him another one, hopefully he can merge all the files together and post the combined sim. My latest version has slider controls to allow:
1, a temperature difference between the left and right hand half of the heater. This can be used to investigate convection due to a temperature difference, and also investigate temperature vs height.
2, a ‘thermal wall factor’ slider which if set to the left gives a purely reflective floor, while if set to the right gives a purely thermal floor. If set in between it gives a mix between reflective/thermal.
3, fan X and Y velocity which controls a blower on the right hand side of the floor, which you can control strength and direction.
I also corrected for the heater collision detection routine, which was not done properly until now.
Playing with these gives some nice looking convection, but the temperature profile with altitude is always hot on top. This is not a simulation error this time – I explained it a few posts up, but it shows it is actually quite difficult to get a temperature gradient which is cold on top!
br1 says:
July 26, 2012 at 9:58 am
This is not a simulation error this time – I explained it a few posts up, but it shows it is actually quite difficult to get a temperature gradient which is cold on top!
==========
It is yet to be shown that the hot on top situation is a simulation error “this time”.
http://www.filedropper.com/gas20120726_1
some small changes to get rid of quirky collisions.
br1 says:
July 26, 2012 at 9:58 am
it is actually quite difficult to get a temperature gradient which is cold on top!
========
What I’m seeing in the sim is that the ratios on the right Cn/Cn-1, these are not equal between layers, especially when using the default simulation. They decrease from top to bottom.
When I switch to Gas, Small the ratios between layers becomes much more equal as I would expect if pressure/density is exponential.
I wonder if what we are seeing is an artifact of the bigger molecules and/or the number of molecules? The ratio’s also appear to be affected by the number of molecules. Too many molecules and too little space?
ferd berple:
“I wonder if what we are seeing is an artifact of the bigger molecules and/or the number of molecules? The ratio’s also appear to be affected by the number of molecules. Too many molecules and too little space?”
That will certainly affect the number ratio between layers – if you jam packed the whole box with molecules, turning it solid, then there would be equal density with height no matter how much the gravity.
Whether that can affect temperature or not I’m not sure (somehow I doubt it, but it would be nice to find out). One thing we do know for sure is that it stresses the collision handling routine!
I was thinking along similar lines for your gradient – if instead of having a factor of 2 counts between layers, have a factor of sqrt(2)=1.4. Then check whether the temperature gradient across three layers in the first case is the same as the gradient across six layers in the second case.
br1 says:
July 26, 2012 at 4:33 pm
One thing we do know for sure is that it stresses the collision handling routine!
============
The collision handler may be the problem. It does two things. It builds a grid of molecule locations (called grid) and searches only those molecules in grid [x +/ -1][y +/- 1]. This limits the molecules searched, but always builds collisions left to right, top to bottom first (or maybe the reverse, you get the idea). This means the collisions are likely skewed preferentially in a direction.
Secondly, it should be possible to only allow collisions within the current time slcie. however, the collision handler does not find some (low energy?) collisions unless you look back as much as 10-20 time slices. This is for sure creating problems in the sim, as it means some collisions are found sooner than others, possibly based on energy.
I’ve changed the logic back to match the original. first I move a ball, then I check for collisions.
However, with just two mols, the time calculated for the collisions a fair percentage of the time exceeds the time slice. This doesn’t seem possible if the collision time is being calculated correctly, because neither mol moves farther than 1 time slice in time between collision checks.
When two balls are overlapped, the overlap must have come about during the past time slice, if the logic is working correctly, so this indicates to me there must be an error, likely in the calculation of time.
double t = (-b-java.lang.Math.sqrt(b*b-4*a*c))/a;
double t2 = (-b+java.lang.Math.sqrt(b*b-4*a*c))/a;
ferd berple:
“so this indicates to me there must be an error”
for sure.
Just to let you know I’ll be away for over a week, and can’t contribute much during that time. Q. Daniels has my latest code, so I hope he pitches in for me.
found the problem.
should be:
double t = (-b-java.lang.Math.sqrt(b*b-4*a*c))/(2*a);
double t2 = (-b+java.lang.Math.sqrt(b*b-4*a*c))/(2*a);
//if (java.lang.Math.abs(t) > java.lang.Math.abs(t2))
// t = t2;
http://www.filedropper.com/gas20120728
lots of testing to eliminate errors as potential cause of negative gradient.
molecules increased to 5000, radius cut in half, collision time corrected, spurious collisions ignored, collision detection randomized, fixup for potential negative energy at lower boundary.
Total Energy rock solid. Collisions appear rock solid. will run it at paint drying speed and report.
there is a weakness in the collision detection routine. two molecules are only considered to have collided when they are overlapped during a time slice. to be accurate this requires time slices to essentially be zero.
still haven’t been able to answer why collisions take place more than 1 time slice in the past, when molecules are only able to move one time slice. when two molecules are overlapped, the condition that caused it should have been during the past time slice. yet we see much larger past times, which are correct, because they are giving the correct separation between the molecules (2* radius).
ferd, still following you. I broke off and wrote a c# version, much simpler in some respects to also try and get all interactions as perfect as possible. The conservation of total energy, ke+pe, on my version is now basically perfect. After three million iterations the only digit that has changed is in the 15th least sig digit. The interaction at the top and bottom took a bit to get this perfect… I’m using a converging Newton-Raphson here to steer away from any square roots for precision digits. Seems the Java is using a quadratic here. Mine also has no interaction at the walls, as a planetary column would have, perfectly homogenous vertically so when one molecule leaves to the left another identical molecule appears at the right to replace it, a simple if x .LT. zero add width type of logic to handle the horizontal conservation of energy. After a day of running mine settles into a small ~2 “degree” bias warmer at the bottom but I still don’t really trust it yet for I too seem to have the same collision problem and I’m going to try to carry mine to use an intersection of segments type of logic instead of only registering an intersection when they overlap after a position update. So, I am still here in the background.
a) Update positions into new set of variables by dt
b) Pre-calculate all new x1-x0, y1-y0 vector lengths
c) Detect segment crosses, if not continue
d) You now have t & s (0 to 1) ratios of intersection so see if by velocities if they hit
e) Do the intersection momentum transfer logic
Also i am now using the same type of pressure logic found in the US.StdAtm76 code, inversed actually, to initialize the column density under gravity so the molecules don’t bounce so bad at startup… it was taking hours for this oscillation-bouncing signature to die out, repeating from warm at top to warm at bottom over and over but dying out… very time consuming !!
Where the Java version was quite lengthy mine is so far a very minimal ~300 lines. Roger and Tim have my e-mail so just ask them for it if you should want the code to compare. Java and c# are very close to the same base language being both c based, you can almost verbatim swap code segments, it’s just that this is where my tools lie over the years so for dev speed that is my preference.
http://i47.tinypic.com/sfxqur.png
wayne says:
July 31, 2012 at 4:10 am
=====
Wayne I’d be very interested in a copy of your code. I wrote c,c++ commercially for years and have VS all in place for c#. pls email a copy to ferdberple(AT)yahoo.com and I’ll watch for it. I’d very much like to get two different sims running to eliminate code dependent problems.
my latest is here
http://www.filedropper.com/gas20120801
a fixup of the collision detection routine.
Hi ferd, sorry, got caught up in Watts et al 2012. I’m half way through cleaning up a cleanup version three and I’ll see if I can finish it tonight before sending it to you tomorrow. Great, since you have VS I don’t have to make it all one unit for simplicity and include instructions how to use the console compiler!☺ (that’s how I was compiling the java, dos style… snail dev but VS editor will colorize java code and even does some limited bracket auto formatting, I had never tried that but it does work)
ferd berple:
“I’d very much like to get two different sims running to eliminate code dependent problems.”
I’m back from travels, and on the way I managed to solve the collision problem exactly. I’ve written my own version from scratch, and this time instead of using a predetermined time step, I calculate the time to the next collision between every molecule, and to the walls. Whatever the least time is, in the future of course, is used as the time step. As there are 15 significant figures calculated, this practically guarantees that only one collision is dealt with in any step, so this can be solved exactly. As it stands, it could be written in a less computationally intensive manner, but it looks like it works even at high packing density. I’ve also added a long term temperature record vs time, so that you can judge whether the temperatures have stabilised.
I have written it in Matlab, which should run under Octave, I’ll revise it a bit more and send it on to you. I haven’t had time to go through all the parameter space yet, but I’ll keep going and let you know when I have some solid results.
I’ve been trying to make my latest code less CPU intensive, and just about have it. One result I have found is that Velasco1996 and Roman1995 make an unstated assumption, that their results are only exactly valid for zero diameter particles. As the particles also need to swap energy by collisions, which can’t happen if the particles have zero size, then this makes their model slightly inconsistent. At least, one should take their result as applying in the limit of small particle size.
If one doesn’t have infinitesimal particles, then the temperature results differ both in magnitude and in gradient as compared to Velasco Eqn(8). The magnitude of the average KE is less than that given in Eqn(8), which can be explained in the limit of stuffing the box full of finite sized particles. In that case, there is no room for the particles to fall, so the gravitational potential energy is higher than it would be if the particles were infinitesimal. This leaves less KE per particle than the infinitesimal maths expects, and violates the result given in Roman where the expectation of KE equals expectation of GPE for a 2D gas. So that is fun! Might even be worth a paper in itself, though I’m aware of some lossless granular gas papers that I’ll have to check over again.
It is less clear to me why the temperature gradient with height should differ – the gradient one gets for finite sized molecules seems to be greater than that given by Velasco Eqn(8). Not by much, and it still goes to isothermal as one increases particle number or reduces particle density, so it certainly doesn’t give anything near the gradient we are looking for, but interesting nevertheless.
Hehe! I think I have the collision routine perfect (running the model as an ‘event driven simulation’), and here’s another result: There is a stated assumption in Roman/Velasco which is that the container is infinitely tall. But when one puts a lid on the container, this prevents molecules from reaching infinite height (obviously!). What is less obvious about this is that it raises the expected temperature of the gas!
The reason for this is that the expectation of KE is practically independent of height. However, the GPE varies linearly with height. By capping the column, one does not allow the GPE of any particle to increase beyond a certain amount, and the centre of mass of the gas is lower than it would be if the column were of infinite height. This makes the total GPE lower than expected, which leaves more energy to be shared amongst the KE. Hence the average KE is slightly higher than Velasco Eqn(8). Going from an infinite column to a capped column might be equivalent to an adiabatic compression – you have the same molecules but confined in a smaller volume, so the temperature increases.
I have run different container heights, and one needs to go to surprisingly high columns in order for Eqn(8) to hold.
ferd: I’ll send the program on to you shortly.
br1 says:
August 4, 2012 at 7:15 pm
I calculate the time to the next collision between every molecule, and to the walls. Whatever the least time is, in the future of course, is used as the time step.
===========
This is pretty much the conclusion I’d come to as to the only way to make the simulation truly realistic, however I ran into a computational brick wall.
For example, consider a molecule resting on the “ground” with vertical velocity of zero. It will always be the molecule that collides “next”.
In effect, a molecule sitting on the ground with zero vertical motion is bouncing infinitely fast, with a bounce height of zero.
This is only one example of what can happen. My concern was that in a situation where there were lots of molecules in contact, such as can happen with gravity, that the time to collision would be zero and the simulation would quickly grind to a halt.
A secondary problem was that as the time slices became smaller, floating point precision might also start to become an issue, as you added up lots of very small time slices.
Both these concerns, but the first one especially, seemed to indicate that computationally you needed to set a limit on how small the time slice could become.
Looking forward to seeing the code.
br1 says:
August 7, 2012 at 11:02 am
infinitely tall. But when one puts a lid on the container, this prevents molecules from reaching infinite height (obviously!). What is less obvious about this is that it raises the expected temperature of the gas!
=========
Interesting!!
I can confirm that if you move the top of the container up and down the temperature decreases and increases. However, if you move the walls in and out the temperature does not change.
This I don’t understand, because it is my understanding that if you reduce the size of a container, the pressure must go up and this should lead to an increase in temperature.
What am I missing?
br1 says:
August 7, 2012 at 11:02 am
Going from an infinite column to a capped column might be equivalent to an adiabatic compression – you have the same molecules but confined in a smaller volume, so the temperature increases.
=============
This is what I thought as well, but when I modified the sim to move the walls in/out, I didn’t see a temperature change.
Which to my mind is exactly what should happen, as moving the walls does not change the KE of the molecules (except perhaps slightly due to the acceleration of the container walls). But this contradicts the observation that compressing a gas by reducing the volume of the container will heat the gas.
thinking more on this, moving the walls didn’t raise the temperature because the sim doesn’t add the movement of the wall to the motion of the molecules. in fact it is purposely designed to do this.
however, this means that moving the top of the container up and down is cooling/heating the gas by a different mechanism than moving the walls.
What it means is that (for example) a piston working vertically should have slightly different efficiency than a piston working horizontally.
This may indeed be worthy of a paper if it has been written up previously.
Thinking more on this,the worst case design if you want compression to heat a gas is to use a vertical piston with the gas above the piston.
ferd berple:
“however, this means that moving the top of the container up and down is cooling/heating the gas by a different mechanism than moving the walls.”
yes indeed.
At first it crossed my mind that you had periodic boundary conditions sideways, so the width of the container has a different sort of meaning than the height. But even with solid walls, there is a different mechanism in the two cases.
If one were to simply step the walls sideways to make the container wider, there will be no cooling of an ideal gas. This corresponds to ‘free expansion’, and only leads to cooling for gases with a non-zero Joule-Thompson coefficient – which only happens when intermolecular attraction is present. There should be cooling if you give the walls a finite velocity outwards, as then the molecules bounce off a moving object and so will lose KE.
If one were to step the top of the container vertically upwards, the situation is different as the average centre of mass of the entire gas also rises a little bit as it expands to fill the new space. As this is true for the *entire* volume of gas, the energy required to do so must come from the KE of the entire gas, and so it cools a little bit. Note that this is very different than the case of an individual molecule!!! For an individual molecule, its KE does of course reduce as it moves upwards in the gravitational field, but it is the energy of the *ensemble* of molecules at each height that determines temperature, and we have been finding that this remains close to isothermal!
br1 says:
“If one were to step the top of the container vertically upwards, the situation is different as the average centre of mass of the entire gas also rises a little bit as it expands to fill the new space. As this is true for the *entire* volume of gas, the energy required to do so must come from the KE of the entire gas, and so it cools a little bit.”
This means that the gas has gained gravitational potential energy at the expense of thermal energy.
Would there not be a apparent second law violation?
Bryan:
“This means that the gas has gained gravitational potential energy at the expense of thermal energy.
Would there not be a apparent second law violation?”
This is the exact question I had which brought me to Graeff in the first place. I thought this might be a violation, googled what others had done, and came across Graeff. Unfortunately I’ve come to the opinion that while this particular effect is real, I can’t see how to use it. One may argue that removing the lid costs no energy, and yet I can find no way to undo this action without doing work – so it is not for ‘free’. How do you make a cycle out of this effect, extracting work as you do so? Everything I think of doesn’t work. For example, you can’t simply slip in the divider back in the original position, as then you lose the molecules that have reached the upper altitudes and the system is not the same. You can’t simply lower the upper molecules back into the lower part of the container, as you would have to use a piston and input mechanical energy. Etc, etc.
I’d like to hear how you might propose to make use of it.
p.s. I sent my simulation to ferd, let’s see what he makes of it.
Bryan, br1 –“..step the top of the container vertically upwards…extracting work as you do so?”
First you have to check if any particles are reaching the top (i.e. the container’s Hmax or Zmax) against the g field. As br1 pointed out, Velasco eqn. 8 assumes an infinite high container like a column of earth’s atmosphere going up past p=0 space vacuum. After that it doesn’t matter if the column top is stepped up from moon to Pluto. If p>0 on top wall, it does. How?
The particles constant total enthalpy = PE + KE + pV being forced constant by law 1 in a rigid, enclosed, adiabatic container means if you move the walls (or the top assuming p > 0 at top) have to account for the energy by/to surroundings in the pV term.
got the code and did a very quick read through. looks good. thanks
1) do you consider the case where a collision early in your minimum time list changes the tail of the list? It seems likely that to be correct you need to recalculate the list after every collision, because that collision could insert a new event into your list, potentially ahead of the rest of the list.
2) how do you handle the case of a molecule lying motionless (vertically) on the ground? It will collide with the ground with dt = 0, and continue to collide with dt = 0; As such, it will always be the minimum time event
Hi ferd,
Just sent you another one, including differential floor heating and a vector plot of momentum to look for circulations. Another nice puzzle with respect to differential heating is raised which I’ll get to in a later post!
In answer to your questions:
1) yes you are right, but only the molecule that has actually collided needs to be recalculated (with respect to all the other molecules and walls). All the other molecule/wall collisions simply get stepped forward in time as they can’t possibly be affected. The new list is then thoroughly searched for the minimum next collision time, taking into account the precalculated list and the newly calculated list. To check this, I have run the simulation with a reduced number of molecules and with large molecule size – there are no ‘ghost’ molecules (where a collision might be overlooked and the molecules pass through eachother) and there are no ‘phantom collisions’ where a collision is taken out of order and the molecules bounce even though they haven’t reached each other yet. So it really looks like it is working.
2) I do have an ‘if dt==0 break’ line in the code which will cause the program to quit, but this condition has never been met! So basically this situation does not arise in practice. Which is convenient!
I’m installing matlab and will give the latest a try.
Ok, here’s the puzzle.
Take a look at this picture: http://s1257.photobucket.com/albums/ii503/brspics/?action=view¤t=Gas2Dv5p0.png
In the upper left quadrant is the molecule position picture – there are 400 molecules bouncing around inside a container, including gravity. The left half of the floor is at a ‘high’ temperature, the right half of the floor is at a ‘low’ temperature (you can tell this visually by noting the different molecule density).
In the upper right quadrant of the picture is the temperature vs time of the gas at different altitudes to see whether the temperatures have stabilised – there is still some wobble, but they are fairly stable.
In the lower left quadrant is a net momentum graph, showing the net flow of molecules at different subsections of the container (long term average). This shows a nice circulation.
In the lower right quadrant is the temperature vs altitude (long term average).
There are two puzzles – one is why the lower right quadrant graph temperature increases with altitude, but I’ve dealt with that in a couple of previous posts on this thread and am fairly happy with the reason.
The second puzzle relates to the lower left figure (net momentum). There is a clear circulation where the gas above the hot part of the floor rises, and that above the cold part of the floor sinks. But the puzzle is the vector at the bottom of the graph, pointing left. This is saying that there is a direct flow of molecules from the cold part of the gas to the hot part. As the heat is only contained in the molecular motion (no radiation in this model), this is saying that heat (=molecules) is travelling from cold to hot. So… how come???
I’m pretty sure of the answer, and what is wrong with the question, but I still find it a nice question!
Here’s another nice little result: http://i1257.photobucket.com/albums/ii503/brspics/SpontaneousConvection.png
This time, the floor is uniformly heated to 10 K, the ceiling uniformly cooled to 1 K, with gravity present. The 1200 molecules spontaneously arrange into a convection cell(s), despited the lateral symmetry (see bottom left figure)! The cell can sometimes go CW, sometimes CCW, depending on what the starting noise was, and sometimes you get double cells. So this model is really quite useful for ideal gas visualisation.
Still no real idea how to get Graeff’s gradient, which is the ultimate goal.
this is saying that heat (=molecules) is travelling from cold to hot. So… how come???
==========
wind flows from cold to hot at the surface and from hot to cold at altitude. the exception is the mid latitudes where the polar and tropical flows induce the westerlies to flow from hot to cold on the surface, making the high latitude temperate zone warmer than it would be otherwise.
The model looks good in my quick check. the matlab plots are a bonus. fiddled around with different sizes for the container and different molecule counts and everything looked very stable. don’t know matlab so some aspects of the code are still a mystery.
Still no real idea how to get Graeff’s gradient, which is the ultimate goal.
===========
Indeed. The dry air lapse rate is too close to G to be coincidental, yet the model results suggest that it cannot exist as a consequence of G. which suggests there is a mechanism at work that is not part of the model.
it reminds me of the model not showing any heating when the walls moved inwards. some natural mechanism that is not properly included in the model,
the model is telling us that KE/PE conversion during conduction is not the mechanism. But the atmosphere is telling us that some mechanism exists. my money is on the work done as air expands/contracts during convection, but how to model this?
and of course if the mechanism is related to convection, then this contradicts Graeff’s work to limit convection.
What about simply installing an elevator at both ends of the model. One end always goes up, the other always goes down. the next work being done with be zero as the upward work at one end should equal the downward work at the other.
ferd berple:
“wind flows from cold to hot at the surface”
sure, but the puzzle is why this doesn’t break 2LoT. After all, the molecules carry their coldness with them, so ‘heat’ is travelling from cold to hot.
Or at least, that’s one confused way of describing it!
Still no real idea how to get Graeff’s gradient, which is the ultimate goal.
===========
Ok, reading wikipedia I can see what looks like a missing part to the sim.
http://en.wikipedia.org/wiki/Lapse_rate
As the air parcel expands, it pushes on the air around it, doing work (thermodynamics). Since the parcel does work but gains no heat, it loses internal energy so that its temperature decreases. The rate of temperature decrease is 9.8 °C per 1,000 m.
This contradicts what we see when the sim walls are suddenly moved outwards. There is no change in observed sim temperature whatsoever. If the sim was matching reality, when the walls moved outwards at infinitely high speed, there would be a drop in temp.
more wikipedia
http://en.wikipedia.org/wiki/Ideal_gas_law
Isentropic process
T2 = T1(V2/V1)^(1 − γ)
The value used for γ is typically 1.4 for diatomic gases like nitrogen (N2) and oxygen (O2), (and air, which is 99% diatomic).
This tells me that we should be seeing a temp change with the volume change, which the sim is not currently showing when the walls move. It appears that the sim models γ = 1.0
fer berple:
“This tells me that we should be seeing a temp change with the volume change, which the sim is not currently showing when the walls move. It appears that the sim models γ = 1.0″
I beg to differ. I fully expect the model to show γ = 1.66 http://en.wikipedia.org/wiki/Heat_capacity_ratio for a monatomic gas. The situation you simulated is not an isentropic process – in fact the entropy increases if you step the walls sideways, and this is not a reversible process (that is, you can’t simply step the wall back to its original position without losing molecules). To do the expansion isentropically, the wall must move (infinitesimally) slowly so that the pressure of the molecules is felt as it expands. The molecules will undoubtedly lose momentum as they bounce off a wall moving away from them, so the gas temperature will drop. This is a reversible process as you can then move the wall (infinitesimally) slowly inwards again to recover the initial configuration, the molecules gaining momentum as the wall moves back in. Doing this in the model is a bit tricky, but I might give it a go.
I think the physics of the DALR is in the model, but the circumstances have not been set up to see it. I have some ideas on that, but it might require too large a particle number to be practical. Still I’ll definitely give this one a shot and let you know – this is where I’m heading with the circulation examples.
p.s. I’ve nearly finished the GUI on my model – makes it a lot easier to set parameters!
br1 says:
August 10, 2012 at 9:44 am
To do the expansion isentropically, the wall must move (infinitesimally) slowly so that the pressure of the molecules is felt as it expands.
============
Questions:
1) When a piston compresses air in a cylinder, does the heating of the air occur only along the face of the piston, where the air molecules are being accelerated by the piston, or does it take place throughout the remaining volume of the cylinder.
2) When a piston moves to expand a cylinder, does the cooling of the air only occur along the face of the piston, or does it take place throughout the remaining volume of the cylinder.
3) When a piston moves a supersonic speed to expand a cylinder, such that few if any air molecules can contact the piston, does this prevent the cooling of the gas in the cylinder?
“The molecules will undoubtedly lose momentum as they bounce off a wall moving away from them, so the gas temperature will drop.”
=========
When the gas is expanding, the individual molecules are (on average) moving away from each other, similar to the wall moving away.
So, if the molecules lose momentum as the wall moves away, they should also (on average) lose momentum as the gas expands and the molecules bounce off the molecules moving away from each other.
This should be seen as drop in temperature as the walls move away, regardless of the wall’s speed. And this drop in temperature should occur throughout the gas, not just along the moving wall.
Air released though a vent from a pressurized cylinder will still experience a cooling within the cylinder, without any movement of the walls. The released air will also cool, even though the gas itself may be accelerated to high speed as it escapes.
I suspect there must be a net loss of momentum as the air molecules bounce off the molecules expanding away from them, which translates into a cooling of the gas as it expands.
The sims are not capturing this effect.
ferd berple:
Here are my answer to your questions. Other opinions may vary
1) Heating occurs along the face of the piston only. But of course, there is conduction, there is the speed of sound (600 m.s-1) to propagate pressure waves, there is diffusion (molecular velocity 1000 m.s-1), there is turbulence… These all act to mix the temperature very quickly in practice, despite gases being poor conductors when compared to solids.
2) likewise.
3) This (and the similar example of air released through a nozzle) is governed by the Joule-Thomson coefficient http://en.wikipedia.org/wiki/Joule%E2%80%93Thomson_effect . This effect is related to intermolecular attraction, which is one effect our models don’t have (yet!). However, this is not needed to explain the DALR! Also note in the figure on Wikipedia that gases can warm due to free expansion!
I agree the sim does miss out on the Joule-Thomson effect, but the gas should very much have γ =1.66, and I believe if given the right conditions should have a DALR. I haven’t reproduced one yet, but I’m working on it
see also http://en.wikipedia.org/wiki/Joule_expansion which shows that free expansion for an ideal gas has Ti=Tf and is not an isentropic process for any gas.
What about the gas left inside the scuba tank? Why does it cool when the tank valve is opened?
ferd berple:
“What about the gas left inside the scuba tank? Why does it cool when the tank valve is opened?”
Nice question! And thinking about it some more I think you have a point and my previous ‘surface only’ answer was not complete.
The way I see it now is that (as well as the surface effect) there will be an effect like evaporative cooling. In this effect, the faster molecules make it into the new space sooner than the slower molecules. This sets up a transient where (when the JT coefficient is zero and the gas is expanding into a fixed volume) the gas in the new space will have a higher temperature and the gas remaining in the old space will have a lower temperature. This is a bit more like a volume effect, as the faster molecules can come from deeper in the gas. After a while, when the expansion is done, the two parts mix and the whole gas recovers the same temperature it started with. If the gas expands into an unlimited space, this recovery second stage mixing doesn’t happen, and the gas left behind will haved cooled slightly. If the JT coefficient is positive, then the gas expanding into the new space will also cool down, and the system can never recover it’s original temperature.
The reason you don’t see this ‘evaporative cooling’ effect in the sim is, I reckon, due to the horizontal averaging of temperature. If you expand to the right then the transient temperature difference will be in vertical bands, the temperature on the right will be hot for a while and the temperature on the left will he cool. If you change the KE binning to show multiple bins horizontally you should be able to see this transient. Then the two sides should mix and the temperature will become uniform again. What do you reckon?
Thanks for staying with this question!
After a while, when the expansion is done, the two parts mix and the whole gas recovers the same temperature it started with.
===============
OK, this makes sense to me.
http://www.filedropper.com/gas20120812
I’ve re-written the code to match the matlab sim. It also includes buttons to expand and contract the container walls/ceiling/floor. The container preserves total E on contraction/expansion.
It was a brute force code conversion and I haven’t optimized it yet. Limited to 200 mols. Runs slowly if the mols are increased much beyond this.
The matlab sim doesn’t appear to be as limited in the number of mols, which makes me hope there is room to optimize. I’ll need to have a detailed look at the algorithm you use to recalc the min time list.
I recalc it fully after each event, as it seems possible that a collision could cascade, invalidating previous calculations, resulting in spurious collisions on the list.
The mols in the new version show up as streaks as the sim speed increases, which are a trace of the mol path since the last display refresh.
Anyhow this new sim might be of interests to try out moving the walls/celing/floor.
OK, I can confirm it is the hotter molecules that move to fill the void when you expand the container on the right. my sim uses the color coding for each molecule and it is obvious.
If I contract the container by moving the right wall to the left, the temp is unchanged, but the pressure goes way up. Then when I move the wall back, the pressure drops, and the hot molecules are the ones that move to fill the void.
Moving the floor up without changing total E reduces the temp, and moving the ceiling down without changing total E increases the temp.
I ran the sim overnight with 500 very small molecules and the reverse gradient is gone. I have a small positive gradient, with the “no walls” option on, and less of a gradient with a closed container.
br1 wrote:
This time, the floor is uniformly heated to 10 K, the ceiling uniformly cooled to 1 K, with gravity present. The 1200 molecules spontaneously arrange into a convection cell(s), despited the lateral symmetry (see bottom left figure)! The cell can sometimes go CW, sometimes CCW, depending on what the starting noise was, and sometimes you get double cells. So this model is really quite useful for ideal gas visualisation.
If you had less of a gradient, or more molecules, it should drop into a chaotic oscillator, going one way, pausing, and then going in a random direction, including the double cell. Pretty standard non-linear dynamics.
ferd berple:
“I’ll need to have a detailed look at the algorithm you use to recalc the min time list.”
yes, this is where the subtleties are.
Initially I did what you did and recalculated everything each time, just to be on the safe side. As that was very slow (as you are finding), I spent quite a bit of time debugging the technique where only the molecules which collided are updated. That was harder than it sounded, but it seems like the code works.
I can also see a few other smart ways to reduce the recalcuation time, so if I get to rewrite this in Java I expect it to be about twice as fast as the current Matlab version, which can already handle 2000 molecules without having a heart attack.
Q. Daniels:
“If you had less of a gradient, or more molecules, it should drop into a chaotic oscillator, going one way, pausing, and then going in a random direction, including the double cell. Pretty standard non-linear dynamics.”
yes, it does this.
That was harder than it sounded, but it seems like the code works
======================
Yes, I added the logic to optimize “already calculated” and it immediately introduced lots of errors. The devil is always in the debugging.
What I do find interesting is that overall, calculating the future events rather than cleaning up the past makes the code quite a bit simpler.
In trying to get a DALR, I went back and calculated what I should expect to see.
We have a 2D gas, and from Velasco1996, this gives
T = E/(2.N.kB)
where E is total energy, N is number of molecules and kB is Boltzmann’s constant. The equation for specific heat is
dE=M.Cv.dT
where M is the total mass and Cv is the specific heat at constant volume. One can simply put these two equations together to get
Cv=2.N.kB/M
Cv=2.kB/m
where m is the mass per molecule.
Cp is related to Cv by http://en.wikipedia.org/wiki/Heat_capacity_ratio#Relation_with_degrees_of_freedom with f=2 as we are dealing with a 2D gas so γ =2 (not γ =1.66 as I said above). This gives
Cp=4.kB/m
Taking m=4.8e-26 kg for a typical air molecule this gives our 2D gas
Cp=1150 J/kg/K
which is basically the same as the measured value. Hence the DALR in the model should be http://en.wikipedia.org/wiki/Adiabatic_lapse_rate#Dry_adiabatic_lapse_rate
DALR=g/Cp
= 0.009 K/m
pretty much the same as observation, even though our gas is 2D not 3D.
However, in the sim I am getting nothing close to this. I have tried all sorts of different thermal gradients (at ground level only (imposing a thermal gradient with height is almost like cheating!)), and used fans pointing in different directions (including horizontal), but I have yet to get a robust temperature drop-off with height. Indeed, every non-equilibrium circulation I try gives an increasing temperature with altitude. I put this down to the barometric formula – as density reduces with altitude according to n=n0.exp(-mgh/kB.T) then regions with higher temperature will throw more molecules to higher altitude than regions of colder temperature. Hence the average molecule could be equally hot or cold at low altitude, but a molecule at high altitude will much more likely have come from a hot region, and as temperature is approximately conserved with height, then the higher regions will be hotter. This reproduces the result that in a closed room the temperature is usually hotter at the ceiling than the floor, even though the greater atmosphere is not like that. I don’t count Velasco Eqn(8) as a robust gradient, as this goes to zero with greater molecule number – I need something much greater than that.
The only way I can get a decent temperature fall off with height is to have heating at the bottom and cooling at the top. It’s starting to seem to me that (as someone else around here said!) the main reason the atmosphere is cooler as one goes up in altitude is not due to gravity or circulations per se (which I’ve been trying to simulate), but due to radiation losses to space – this cooling then allows the circulations to be set up, and for stable and unstable lapse rates to be established. I’ll play around with applying thermal gradients next and see what the resulting circulations do.
It may be that I need much greater particle number, due to the question ‘what is a parcel anyway?’, but the parcel still must dump its energy at high altitude, as it performs work, so unless that energy can be dissipated it will still leave the system hot on top.
It’s starting to seem to me that (as someone else around here said!) the main reason the atmosphere is cooler as one goes up in altitude is not due to gravity or circulations per se (which I’ve been trying to simulate), but due to radiation losses to space
============
Doesn’t this lead to a contradiction of current GHG theory?
N2 and O2 are essentially non radiating at 300k. Thus, if cooling is due to radiation, then without GHG the atmosphere would be warmer at altitude than present, which would reduce convection from the surface making the surface hotter.
Thus, if GHG are the reason the atmosphere is cooler with altitude, then GHG must provide a net cooling effect at the surface, contrary to the belief that GHG warms the surface.
The lapse rate then becomes the maximum amount of cooling permitted before gravity and convection step in to limit the rate of cooling.
Thus adding GHG to the atmosphere will have no effect on temps, because the only effect it can have is to provide a net cooling, and this is already limited by the lapse rate
ferd berple says
“Thus adding GHG to the atmosphere will have no effect on temps, because the only effect it can have is to provide a net cooling, and this is already limited by the lapse rate”
This is very much in line with a recent post by Leonard Weinstein at scienceofdoom.
http://scienceofdoom.com/2012/07/23/how-the-greenhouse-effect-works-a-guest-post-and-discussion/
ferd and Bryan:
“This is very much in line with a recent post by Leonard Weinstein at scienceofdoom.
http://scienceofdoom.com/2012/07/23/how-the-greenhouse-effect-works-a-guest-post-and-discussion/”
I read that article, and got the exact opposite meaning – adding GHGs will result in an increase in surface temperature. I didn’t read all the discussion (nearly as long as this thread!!!), but I didn’t see any comments that came to any other conclusion.
Weinstein’s main argument, as I read it, was that GHGs make the atmosphere more opaque to radiation around 10 um. Hence the 300 K thermal radiation from the surface has a harder time escaping, so the surface temperature needs to increase in order to maintain the same power loss.
That GHGs are better emitters as well as absorbers increases the emission from the upper atmosphere, so the ‘top of atmosphere’ moves to higher altitude, but this just makes the atmosphere ‘thicker’. The discussion about ‘what does back radiation do anyway?’ did not change the general conclusion, it was more a question of how one talks about it.
By the way, during my discussion with Doug Cotton on this blog, I wrote an atmosphere radiation transfer model, downloaded the Hitran absorption coefficient database, and set up a simple planar atmosphere to address this question. It had the general property that increasing CO2 increased the surface temperature. I wouldn’t like to say by how much (due to the various simplifications), but there was no way the surface cooled. I can send that on to ferd if you like.
br1
Leonard’s main point was that ‘backradiation’ did not heat the Earth surface.
IR active gases like CO2 and H2O allow the Earth to cool at the TOA.
Adding some more CO2 simply lifts the troposphere a little.
Leonard did a calculation showing showing that the resulting increased surface temperature was minimal and would hardly be measurable.
The insulating effect of the atmosphere moderates the excessive high and low temperatures.
Solar radiation at the equator would produce temperatures of around 120C.
Its pretty clear that in this respect the atmosphere has a cooling function.
At night in the Antarctic temperatures would drop even lower without an atmosphere.
The insulating effect of the atmosphere works in both directions reducing heat flow in and out.
Gravity and heat capacity (Cp) determines the lapse rate of dry air.
If the GHG already has a net cooling effect already – TOA cooler than surface – adding more GHG cannot somehow reverse this and have a net warming effect. Unless the amount of GHG was somehow at a magical minimum/maximum for cooling.warming.
So, the argument that GHG is causing the net cooling at the TOA as compared to the surface means that any blockage of outgoing radiation is more than offset by increased radiation and blockage of incoming radiation. Or the current GHG would have already caused the TOA to be warmer than the surface.
The sim does show that there is a gravity PE/KE warming cooling, but so far we haven’t found a way to use this to recreate the DALR.
This doesn’t necessarily mean that radiation is the cause of cooling TOA, as we would need to demonstrate the DALR using a heater at the surface and a cooler at TOA.
Bryan:
I was surprised at your previous post, so I went back and read the linked thread in a little more detail, paying attention to your posts. All I’ll say is that I think you have substantially misinterpreted the original post. However, this thread is not the place to start all that again, but I’d be happy to discuss this elsewhere if it comes up again.
In the mean time, I’m starting to see a real DALR in our 2D gas sim. This does not contradict my DALR post from yesterday! More shortly.
br1
With no IR active gases in atmosphere.
Means at night
Earth surface cools by radiation
Air near Earth surface cools by contact with surface
Dense layer forms cutting out the possibility of convection.
At higher altitude N2 and O2 stuck at high temperature without means to cool down
Air at top of troposphere warmer than at bottom.
An inverted lapse rate.
However there are active gases in atmosphere (CO2 and H2O)
This gives a path for N2 and O2 to cool by collisional activation then emission of IR radiation.
This cooling effect makes possible our lapse rate.
Agree with you
“However, this thread is not the place to start all that again,”
Good luck with your simulation.
I wrote:
If you had less of a gradient, or more molecules, it should drop into a chaotic oscillator, going one way, pausing, and then going in a random direction, including the double cell. Pretty standard non-linear dynamics.
br1 wrote:
yes, it does this.
We’re talking about chaotic systems. Around some threshold, they will switch from one mode to another (ie laminar versus turbulent). The model densities (MFP) and gravity levels I was looking at earlier were more typical of the thermosphere than the troposphere.
The only times I saw something approaching a DALR was when gravity was turned down to almost nothing with thousands of particles. At that point, the vertical fluctuations were roughly equal in magnitude to the horizontal fluctuations.
If the fluctuations scale with N^0.5, and we work with cubic volumes, then we’re still uniform over all scales (z^3/z)^0.5.
Thinking further along those lines, I found this paper: http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19850022234_1985022234.pdf
I started digging into it, but I got distracted.
My thought for how to go forward is Navier-Stokes for a compressible fluid (since density does change), and Fluctuation Theorem (equilibrium is the average of the fluctuations).
Hi Q.
“My thought for how to go forward is Navier-Stokes for a compressible fluid (since density does change), and Fluctuation Theorem (equilibrium is the average of the fluctuations).”
While I know of the Navier-Stokes equation, I have never really worked with it. One thing that puzzles me about it (and for example the paper you linked, or Bernouilli’s equation etc) is that there is no mention of temperature? Or am I wrong?
It is all very well for the parameters that go into it being temperature dependent, for example viscosity has a temperature dependence, but how does one get temperature *out* of these equations?
A quick search for Navier-Stokes and temperature came up with this example http://num.math.uni-goettingen.de/bail/documents/proceedings/morinishi.pdf , but I don’t think this helps, as it only finds a temperature profile after a temperature difference is imposed. If there was no *applied* temperature difference, then it seems the solution would be isothermal. Maybe.
“In the mean time, I’m starting to see a real DALR in our 2D gas sim. This does not contradict my DALR post from yesterday! More shortly.”
Ok, here is the general result:
http://s1257.photobucket.com/albums/ii503/brspics/?action=view¤t=DALR_10g.png
I wrote a commentary along with the picture:
“In this 2D kinetic gas model, a heater is placed on the floor, shown by the red line in the left two figures. There is an 80 K difference between the heater and the rest of the floor. One can see from the bottom left figure that this sets up a circulation, and from the bottom right figure that the temperature with height varies above each section of the floor. In the bottom right figure, the red trace shows temperature with altitude above the heater – this updraft gives a temperature which drops off with a lapse rate given by DALR=g/Cp=g.m/(4*kB) where g is the acceleration due to gravity, m is the mass per molecule and kB is Boltzmann’s constant. This equation gives the thin black line. The blue curve shows the temperature above the right hand side of the floor where there is a downdraft. In the case of a pure DALR, the temperature should increase as the gas descends, but as the circulation is over a cold section of the floor, conduction imposes that the temperature must decrease. So while conduction is undoubtedly significant, one can see that the rates in the updraft and downdraft are different, implying an adiabatic component. At altitudes above 1000 m, where there are no updrafts or downdrafts, the temperature remains isothermal with altitude and is equal across the different regions. This approximately reproduces the troposphere and thermosphere behaviour. One difference between this model and the real atmosphere is that the average temperature of the whole gas actually increases with height. To get a net reduction in temperature with height, one needs to lose heat from the higher altitude layers. This is done in the atmosphere by radiation to space, but that is not included in this model.”
So I sort of got the troposphere/thermosphere behaviour I was looking for.
It is clear though that as it stands the model won’t reproduce Graeff’s result, despite the presence of gravity.
Just an update to say that conduction effects are probably way too high in the previous figure to give a good example of DALR. Still, one can see a circulation region up to a certain altitude, above which there is an isothermal non-circulating region, all driven by temperature differentials.
From playing with the model, I’m wondering whether one can get a DALR based on steady-state thermal sources. It may well be the case that the day/night heating and cooling also plays a very significant role, as this could generate ‘pulses’ of thermal energy which may be needed to generate a ‘parcel’ of air which can lift and expand into the surroundings. If there are only steady sources, then one gets circulations, but one ends up with a steady solution which has already compensated for the different pressures at different altitudes, so after a while no further expansion work is done. At which time one gets conduction temperature differences but no work temperature differences. Maybe.
br1
I never did get the MATLAB copy optimized version of the sim going. I installed code to check for overlap on the molecules and it found that some collisions were bring missed. I see in the matlab there is also code for spurious collisions, which suggests that maybe MATLAB is seeing some problems. I also get spurious collisions in my optimized recalc code.
my optimized code marks every molecule for recalculation that collides with anything, and every molecule that is predicted to collide with this first molecule, recursively until exhaustion, and still it is missing some molecules that need recalculation.
I have a single switch I can change on the fly between full and optimized recalc, and the test routines show no errors over days of running with full recalc, and within less than a minute at reasonable speed I start seeing reports of overlapped molecules or spurious collisions when I switch to optimized recalc.
this suggests that maybe calculating which molecules need recalc is more difficult than might first appear. I haven’t been able to work out what is going wrong. there must be condition where a molecule needs recalc, that is not being detected.
Also, using the sim in full recalc mode, I do get a small positive gradient. warmer at surface. not as large as graeff, but it is consistent.
ps: the optimized recalc still makes mistakes if you run the sim slowly, it only takes longer for them to appear. the underlying problem appears to be in predicting which molecules are going to need a recalc when a collision (wall or other molecule) takes place. in theory only those molecules that have a relationship to the affected molecule, as well as the affected molecule should be involved in the recalc, but after very many attempts to get this right in the code it doesn’t work reliably.
it appears that under some conditions that this doesn’t work. even when you use a trivial sim with only 3 molecules, at some point in time it fails unless everything is recalced on each collision. there doesn’t appear to be anything consistent in the proceeding events, except perhaps the failures are more common when collisions are complex.
Hi ferd,
Thanks to your pursuit of this, I can see one flaw in my recalc, but I haven’t had time to fix it. I’ll let you know how I get on.
By the way, when you say that an overlap is found, what is the per cent? Do you find 1%, 10%, or even completely overlooked collisions? I’ll put in overlap detection in my code and see what I get.
ok, think I solved the collisions (again!) – I’ve sent you another copy. From my first tests, I can’t see any errors. What do you think?
The overlaps I saw were on the order of 1e-14 or less, which is just double precision error. What is your condition for ‘fail’?
Note that lines 178-181 calculate the gradient expected from Velasco1996, but also see my comment above, at https://tallbloke.wordpress.com/2012/06/28/graeffs-experiments-and-2lod-replication-and-implications/#comment-30392 where finite sized molecules will be slightly cooler and give a (slightly) steeper gradient than Velasco.
I’ve added this as a test, as it was similar to the test I used. I’m not hearing any beeps so it looks like you have it working.
if normd<2*r-.00001
%(2*r-normd)/(2*r) % check if there is any significant overlap
beep;
end
But the speed appears to be no better (or worse) than recalc all?
I am seeing a small negative gradient as per Velasco. Full recalc still gives reasonable speed in java w 300 mols. much more and it bogs down.
Hi ferd,
Glad we appear to be making progress.
In the Matlab version I sent you, I turned down the plotdt and storedt values in order to slow the sim down to try to see any collision errors by eye. Now we don’t seem to be getting any, we can turn these back up (say to plotdt=0.01;storedt=0.005; or higher). I can still run the sim with 2000 molecules in a fairly dense packing without it being painfully slow (using 25% CPU time on a 4 processor PC) so could go a bit higher if needed. I expect Java to be faster than Matlab, which is a semi-interpreted language. Which reminds me, I must give Java a go again, I can think of quite a few computational short-cuts I could take instead of doing full Matlab matrix calculations (which are more convenient but do some unnecessary stuff too).