Monday, March 31, 2014

Pressure-Volume relationship for ideal gas undergoing adiabatic compression

So now you know molecular dynamics and you want to implement your code for some real world problem. Let us see what is the first problem that you should attempt. You all know about adiabatic compression/expansion of gases. In general a reversible adiabatic process is isentropic i.e. there is no change in entropy during the transition. But, you also know that in reality no process is a reversible process. So, let us study what happens to the entropy when the adiabatic compression is no longer reversible i.e. the process occurs at a finite rate.

You may be wondering why an isothermal process not chosen in the beginning. The reason is very simple. Remember that the first law of thermodynamics is sacrosanct (The second law is not and is valid only in statistical limit). From first law of thermodynamics we know that:

${\Delta Q = \Delta U + \Delta W}$

Here ${\Delta Q}$ represents heat flowing into/out of the system, ${\Delta U}$ represents the change in internal energy of the system and ${\Delta W}$ represents the work done by the system. For an isothermal process, ${\Delta U}$ is zero. Therefore, ${\Delta W}$ is equal to ${\Delta Q}$. But the problem is: in molecular dynamics neither calculating heat flowing into/out of the system is trivial nor is the process of keeping the system in constant temperature. For an adiabatic process, ${\Delta Q}$ is zero and thus, ${\Delta W}$ is equal to ${\Delta U}$. The change in internal energy can be calculated very easily. For example, in case of ideal gases, it is simply equal to final kinetic energy - initial kinetic energy. Consequently, it becomes extremely simple and intuitive to employ adiabatic transition process. Similar problem is done in: Phys. Teach. 41, 450 (2003); doi: 10.1119/1.1625202. We would deal with constant temperature molecular dynamics at a later stage.

Now, that we have understood why an isothermal process needs to be avoided, let us look at the theoretical aspect of the adiabatic transition process. Again for simplicity, we are looking at an ideal gas in a configuration as shown in the figure below. Both the masses have negligible height.


The process with which we are simulating gas expansion is by removal of the mass $m$.  As a result of removal of mass, gas lying in region A expands. Let the initial state of the system be denoted by $P_0,V_0,T_0$, and the final state by $P_1,V_1,T_1$. The final state is now dependent on how is the mass $m$ getting removed. 
Let us assume that the mass $m$ is removed instantly. The initial energy of the system comprises of the internal energy of the gas + potential energy of the masses. The internal energy of an equilibrated gas is given by ${U_{gas}=PV/\left(\gamma-1\right)}$. Consider the datum to be such that the potential energy of the masses is zero. Let the gas expand up to a height of $h$. From the first law of thermodynamics, the internal energy of the system remains constant i.e.

${\dfrac{P_0V_0}{\gamma-1} =  \dfrac{P_1V_1}{\gamma-1} + Mgh}$

Now, in its final position, the pressure with the gas would be such that the force would balance the weight due to mass $M$ i.e.
${P_1A=Mg}$

The final volume can also be related to height through: ${V_1=V_0 + Ah}$. Here, $A$ is the surface area. Substituting everything back to second last equation results in:
${\dfrac{P_0V_0}{\gamma-1} =  \dfrac{P_1V_1}{\gamma-1} + P_1\left(V_1-V_0\right)}$

From this equation it is now possible to plot the Pressure-Volume diagram of the gas and integrate the PV diagram to obtain the work. Interestingly, the approach of force balancing until equilibration occurs is wrong. The reason being it is theoretically impossible to define and quantify the force during the transition process. The approach via energy as shown before is simple and easy to follow. Since, entropy is a state function, determination of increase/decrease of entropy is dependent on our ability to calculate the "state" in which the system is. We can calculate the state of the system through the method highlighted before.

In the previous part we have made an implicit assumption that post compression, given sufficient time, the system would result in a new equilibrium state which is characterized by ${P_1, V_1, T_1}$. Let us now redefine the problem. We want to calculate the entropy when there is an irreversible adiabatic expansion/compression occurring using molecular dynamics . So, the problem now becomes determination of updated Pressure $P_1$ and updated temperature $T_1$ to characterize the compressed state of the system.

We assume that the piston (which expands the gas) particles interact with the gas particles through a hard-sphere type potential i.e. upon collision with piston particles, the gas molecules are instantly reflected elastically. Now, since the piston is moving at a finite rate, the reflected velocity of the gas molecules would be their pre-collision velocity - piston-velocity. This kind of a model also ensures that work is done on the system by the piston. Rate of compression can be controlled by altering the piston-speed.  If the speed is very high, this would imply instant removal of the mass $m$ as highlighted before. A low speed indicates gradual removal of the mass $m$. I will put up MATLAB code based on the previously given format in some time.

No comments:

Post a Comment