16
Simulation setup #1, just use mean velocity g Upper and lower surfaces have temperatures Tu and Tl. Molecule adhered to lower surface with zero KE. Gravitational field present. Tu Tl Tu Tl-(KE 1 /C.M) Molecule emitted from lower surface, with energy KE 1 according to mean of temperature of lower surface. Temperature of lower surface drops as it has given energy to the molecule. C is heat capacity, M is mass of surface. KE 1 =0.5mv 2 Tu Tl-(KE 1 /C.M) KE 2 =0.5mv 2 - mgh As molecule rises in gravitational field, its kinetic energy reduces Tu+(KE 2 /C.M) Tl-(KE 1 /C.M) If molecule reaches upper surface, it adheres to it, comes to rest and gives its energy to upper surface. Temperature of surface increases due to deposited energy. If fails to reach upper surface, it returns to lower surface at same speed. Tu +(KE 2 /C.M)-(KE 3 /C.M) Tl-(KE 1 /C.m)+(KE 4 /C.M) KE 4 =0.5mv 2 + mgh Molecule emitted from upper surface with a new velocity in accordance with mean of temperature of upper surface. It gains mgh of KE as it falls in a gravitational field, and gives this energy to the lower surface, which rises in temperature by KE 4 /CM. The system then goes back to initial step. KE 3 =0.5mv 2 KE=0 KE=0

Gas in a box temperature gradient 1d

Embed Size (px)

Citation preview

Page 1: Gas in a box temperature gradient 1d

Simulation setup #1, just use mean velocity

g

Upper and lower surfaces have temperatures Tu and Tl. Molecule adhered to lower surface with zero KE. Gravitational field present.

Tu

Tl

Tu

Tl-(KE1/C.M)

Molecule emitted from lower surface, with energy KE1 according to mean of temperature of lower surface. Temperature of lower surface drops as it has given energy to the molecule. C is heat capacity, M is mass of surface.

KE1=0.5mv2

Tu

Tl-(KE1/C.M)

KE2=0.5mv2 - mgh

As molecule rises in gravitational field, its kinetic energy reduces

Tu+(KE2/C.M)

Tl-(KE1/C.M)

If molecule reaches upper surface, it adheres to it, comes to rest and gives its energy to upper surface. Temperature of surface increases due to deposited energy. If fails to reach upper surface, it returns to lower surface at same speed.

Tu +(KE2/C.M)-(KE3/C.M)

Tl-(KE1/C.m)+(KE4/C.M)

KE4=0.5mv2 + mgh

Molecule emitted from upper surface with a new velocity in accordance with mean of temperature of upper surface. It gains mgh of KE as it falls in a gravitational field, and gives this energy to the lower surface, which rises in temperature by KE4/CM. The system then goes back to initial step.

KE3=0.5mv2

KE=0

KE=0

Page 2: Gas in a box temperature gradient 1d

Calculating the velocity, sim #1

Red curves are analytic expressions of 1 and 2 equations in the above paper The mean velocities for these curves can be calculated analytically, and they depend on temperature according to meanphi1v=sqrt(pi*kB*T/(2*m)); meanphi2v=sqrt(2*kB*T/(pi*m)); Use these values to fix the velocity of the particle as it leaves a surface of temperature T

Two distributions are needed, according to 'Thermal walls in computer simulations', R. Tehver, Phys Rev E 1998, <http://pre.aps.org/abstract/PRE/v57/i1/pR17_1>

Page 3: Gas in a box temperature gradient 1d

numcol=1*1000000; % how many collisions to run for datalength=10000; % how many to store dofullMB=0; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2 T0=30; % K startdT=-2; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=400; % height of box, m iCMu=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

initial dT = -2 K

initial dT = +2 K

Temperature of upper and lower surfaces go to separate values which are stable against starting conditions. Upper surface becomes colder than lower surface!

Use mean velocity, change starting conditions

upper surface temperature

lower surface temperature Dashed box contains parameters used in simulation

Temperature vs time plot

upper surface temperature

lower surface temperature

Page 4: Gas in a box temperature gradient 1d

numcol=1*1000000; % how many collisions to run for datalength=10000; % how many to store dofullMB=0; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2 T0=30; % K startdT=2; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=40; % height of box, m iCMu=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Use mean velocity, change height

h=400 m

h=40 m

Temperature difference is proportional to height so can assign a Kelvin/metre value to the gas.

Page 5: Gas in a box temperature gradient 1d

Summary of simulation #1

If the particle leaves the surface according to the mean velocity associated with the temperature of that surface, then the temperatures of each surface diverge, then settle on a value where the upper surface is cold and the lower surface is hot. The temperature difference is proportional to height.

Page 6: Gas in a box temperature gradient 1d

Simulation setup #2, Use full Maxwell-Boltzmann distribution for particle velocity

g

Upper and lower surfaces have temperatures Tu and Tl. Molecule adhered to lower surface with zero KE. Gravitational field present.

Tu

Tl

Tu

Tl-(KE1/C.M)

Molecule emitted from lower surface, with random velocity according to M-B temperature statistics of lower surface. Temperature of lower surface drops as it has given energy to the molecule. C is heat capacity, M is mass of surface.

KE1=0.5mv2

Tu

Tl-(KE1/C.M)

KE2=0.5mv2 - mgh

As molecule rises in gravitational field, its kinetic energy reduces

Tu+(KE2/C.M)

Tl-(KE1/C.M)

If molecule reaches upper surface, it adheres to it, comes to rest and gives its energy to upper surface. Temperature of surface increases due to deposited energy. If fails to reach upper surface, it returns to lower surface at same speed.

Tu +(KE2/C.M)-(KE3/C.M)

Tl-(KE1/C.m)+(KE4/C.M)

KE4=0.5mv2 + mgh

Molecule emitted from upper surface with a new random velocity in accordance with temperature statistics of upper surface. It gains mgh of KE as it falls in a gravitational field, and gives this energy to the lower surface, which rises in temperature by KE4/CM. The system then goes back to initial step.

KE3=0.5mv2

KE=0

KE=0

Page 7: Gas in a box temperature gradient 1d

First of all, check if can pick out random numbers according to a given distribution

Red curves are analytic expressions of 1 and 2 equations in the above paper

Blue curves are histogram values of an ensemble of random velocities picked by the simulation

distributions and average values match exactly, so technique works

the greater the number of velocities chosen, the closer the match is

Two distributions are needed, according to 'Thermal walls in computer simulations', R. Tehver, Phys Rev E 1998,

<http://pre.aps.org/abstract/PRE/v57/i1/pR17_1>

Page 8: Gas in a box temperature gradient 1d

numcol=2*1000000; % how many collisions to run for datalength=10000; % how many to store dofullMB=1; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=0; % ms-2

T0=30; % K startdT=5; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=400; % height of box, m iCMu=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Now run simulation again, using Maxwell-Boltzmann distribution, gravity set to 0

Start upper and lower surfaces at different temperatures to see where they end up. If no gravity, then all molecules can reach the upper surface, and the velocity distribution is ‘full’. Note vz itself is not actually a M-B distribution, but a ‘phi1’ distribution according to the ref.

upper surface temperature

lower surface temperature

Page 9: Gas in a box temperature gradient 1d

numcol=1*1000000; % how many collisions to run for datalength=10000; % how many to store dofullMB=1 ; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2

T0=30; % K startdT=-2; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=400; % height of box, m iCMu=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Now turn on gravity

dT = -2 K

dT = +2 K

If particle leaves surface with a random velocity taken from the ‘phi1’ distribution, both surfaces come to the same temperature! This is true even in the presence of a gravitational field, and even if they start out at different temperatures.

Page 10: Gas in a box temperature gradient 1d

numcol=120*2700000; % how many collisions to run for datalength=300000; % how many to store dofullMB=1 ; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2 T0=30; % K m=4.8e-26; % kg, average molecule of air h=4000; % height of box, m iCMu=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Run for longer time to check long term behaviour

Temperatures equalise, then they just fluctuate around the average value, even if start out at different temperatures. This run calculated over 300 million collisions.

Page 11: Gas in a box temperature gradient 1d

numcol=120*2700000; % how many collisions to run for datalength=300000; % how many to store dofullMB=1; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2 T0=30; % K startdT=5; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=4000; % height of box, m iCMu=1e17; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e17; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Change heat capacity of upper and lower surfaces

If give the upper and lower surfaces greater heat capacity, then takes longer to reach equilibrium and the temperature fluctuations are less.

Page 12: Gas in a box temperature gradient 1d

numcol=10*2700000; % how many collisions to run for datalength=100000; % how many to store dofullMB=1; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2 T0=30; % K startdT=5; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=4000; % height of box, m iCMu=2e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Change heat capacity of just the upper surface

If give the upper surface half the heat capacity of the lower surface, then the average tends towards the upper surface temperature.

Page 13: Gas in a box temperature gradient 1d

Change heat capacity of just the upper surface

Conversely, if give the upper surface twice the heat capacity of the lower surface, then the average tends towards the upper surface temperature.

numcol=20*2700000; % how many collisions to run for datalength=100000; % how many to store dofullMB=1; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2 T0=30; % K startdT=5; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=4000; % height of box, m iCMu=0.5e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Page 14: Gas in a box temperature gradient 1d

Have height of box so high that only a few molecules can reach it

Previous four slides had surfaces 4000 m apart, and the temperature is only 30 Kelvin. Every now and then there is a molecule which reaches the upper surface, but most of the time it didn’t have enough energy.

Velocity profile of those molecules which hit

Molecules have to leave lower surface with a speed of at least 290 ms-1. The average of the thermal distribution is 116 ms-1. The average velocity of those molecules leaving the lower surface which strike the upper surface is 308 ms-1, nearly three times the thermal mean of 116 ms-1 but still the surfaces come to the same temperature.

Page 15: Gas in a box temperature gradient 1d

numcol=10*2700000; % how many collisions to run for datalength=100000; % how many to store dofullMB=1; % whether to use mean or full M-B statistics skip=1; % only for plotting large datasets at end kB=1.38e-23; % JK-1 g=9.8; % ms-2 T0=30; % K startdT=5; % K, how many degrees away from T0 to start each surface m=4.8e-26; % kg, average molecule of air h=400; % height of box, m iCMu=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of upper surface iCMl=1e18; % inverse of heat capacity, 1/(thermal heat coefficient x mass) of lower surface

Change height of box

If bring the upper and lower surfaces closer together, they come to equilibrium faster, as more of the molecules have enough energy to impact the upper surface. The velocity distribution is ‘fuller’, as less low speed molecules are cut off.

Page 16: Gas in a box temperature gradient 1d

Summary

With gravity turned off, upper and lower surfaces come to the same temperature energy conserved and temperatures equal, so good numerics With gravity turned on, surfaces still come to the same temperature! this is very counterintuitive BUT … this happens when you take Maxwell-Boltzmann statistics for the particle velocity. If just use the mean of the MB distribution for the particle velocity, then the temperatures come to two different stable values, with the lower surface at higher temperature than the upper surface. This ‘mean velocity’ temperature difference is directly proportional to height. SO The long term random behaviour does not converge to the random mean behaviour! Why???