Compression Heating

Set the volume of the gas, V=, and the number of steps nstep= to reach this volume.

Reset

Work is usually done whenever volume is changed.  Change the volume and observe the increase or decrease in temperature.  If you change the pressure very slowly, i.e., use a large number of steps, you can approximate adiabatic compression or expansion.   If, on the other hand, you expand the volume in a single step, you will approximate free expansion into a vacuum.

Setting the bottom wall to be a thermalizing wall is a good way to model isothermal compression. Both the heat capacity of the gas and the thermal conductivity effect are responsible for the time it takes the gas to reach thermal equlibrium.  Set bottom wall to 20 temperature units.   Reset the bottom wall to elastic collisions.


Script Example (Partial)

<script language="JavaScript">
function setVol(v, s){
    newVol=eval(v);
    if(newVol<minVol){
        alert("Volume cannot be less than " + minVol+".");
        document.dataForm.volField.value=minVol;
        newVol=minVol;
    }
    nSteps=eval(s);
    if(nSteps<1){
        nSteps=1;
        document.dataForm.stepField.value=minVol;
    }
    document.Molecular.setVolume(newVol,nSteps);
}
</script>