Specific Heat

Set the temperature of the bottom wall: 

Init

Heat will flow into and out of an ensemble if the ensemble is in contact with a heat reservoir.  This simulation tracks the internal energy of the gas, N<KT>, and the heat flow into the gas from the bottom wall, Q.  Internal Energy is shown in blue and heat flow is shown in red.


Script Example

<script language="JavaScript">
function initSH(){
    document.Molecular.setAutoRefresh(false); 
     document.Molecular.setDefault();
     document.Molecular.setShowControls(false);
     document.Molecular.setPeriodicH(false);
     document.Molecular.setPeriodicV(false);
     document.Molecular.createParticles(40);
     eid=document.Molecular.getEnsembleID();

     document.Molecular.setAutoRefresh(true);

     document.DataGraph.setAutoscaleX(true);
     document.DataGraph.setAutoscaleY(true);
     document.DataGraph.setMinMaxX(0,6.5);
     document.DataGraph.setMinMaxY(-6,6);
     document.DataGraph.clearSeries(1);
     document.DataGraph.setSeriesStyle(1,true,0);
     document.DataGraph.setSeriesRGB(1,255,0,0);
     document.DataGraph.clearSeries(2);
     document.DataGraph.setSeriesStyle(2,true,0);
     document.DataGraph.setSeriesRGB(2,0,0,255);

     document.DataGraph.setLabelY("U & Q"); 
     document.DataGraph.setLabelX("Time"); 
     document.DataGraph.setTitle("Internal Enery and Heat vs Time"); 

     gid=document.DataGraph.getGraphID();
     document.Molecular.deleteDataConnections(); 
     cid=document.Molecular.makeDataConnection(eid,gid,1,"time","qb/dt");
     document.Molecular.setConnectionSmoothing(cid,10);  
     document.Molecular.makeDataConnection(eid,gid,2,"time","t*n"); 
     document.Molecular.setWallTemp("bottom", 1); 
     document.Molecular.forward();
}
</script>