Thermal Conductivity

Init

Hot and Cold Walls

In addition to the usual reflecting or periodic boundary conditions, Molecular Dynamics Physlets can have thermalizing walls.  A thermalizing wall assigns the particle a random velocity based upon the temperature of the wall.  The above simulation has hard wall boundary conditions in the vertical direction and thermalizing hard walls in the horizontal direction. The left wall has a temperature of 128 and the right wall has a temperature of 1.  Wall temperature is defined to be <KE> = k T where Boltzmann's constant, k = 1.

Walls are data sources that keep track of particle collisions during each time step.   The right and left walls in this simulation report both their heat flow and pressure to a DataTable applet.  In order to reduce statistical fluctuations, the data connection has been scripted to average over the last 100 data points.   (See the pressure script for an example of the effect of smoothing.)


Script Example

<script language="JavaScript">
function hotcold(){
    document.Molecular.setAutoRefresh(false); 
    document.Molecular.setDefault();
    document.Molecular.setShowControls(false);
    document.Molecular.setPeriodicH(false);
    document.Molecular.setPeriodicV(false);
    document.Molecular.createParticles(50);
    for(i=0;i<50;i++){
        document.Molecular.setParticlePos(i,-19.0+4*(i%10),3-6*Math.random());
    }
    document.Molecular.setWallTemp("left", 128);
    document.Molecular.setWallTemp("right", 1);
    document.Molecular.setAutoRefresh(true); 

    document.DataTable.setAutoRefresh(false);   
    document.DataTable.setDefault();
    document.DataTable.setDataStride(1,2);
    document.DataTable.setDataStride(2,2);
    document.DataTable.setDataStride(3,2);
    document.DataTable.setSeriesLabel(1,"P Left");
    document.DataTable.setSeriesLabel(2,"Q Left");  
    document.DataTable.setSeriesLabel(3,"P Right");
    document.DataTable.setSeriesLabel(4,"Q Right");
    document.DataTable.sizeToFit(true);
    document.DataTable.setAutoRefresh(true);   
    tid=document.DataTabsle.getTableID();

    document.Molecular.deleteDataConnections(); 
    eid=document.Molecular.getEnsembleID();
    cid=document.Molecular.makeDataConnection(eid,tid,1,"pl","0"); 
    document.Molecular.setConnectionSmoothing(cid,100);
    cid=document.Molecular.makeDataConnection(eid,tid,2,"ql/dt","0"); 
    document.Molecular.setConnectionSmoothing(cid,100);
    cid=document.Molecular.makeDataConnection(eid,tid,3,"pr","0"); 
    document.Molecular.setConnectionSmoothing(cid,100);
    cid=document.Molecular.makeDataConnection(eid,tid,4,"qr/dt","0"); 
    document.Molecular.setConnectionSmoothing(cid,100);

    document.Molecular.forward();
}
</script>