{"id":2083,"date":"2023-06-30T23:30:00","date_gmt":"2023-07-01T03:30:00","guid":{"rendered":"http:\/\/underthehood.blogwyrm.com\/?p=2083"},"modified":"2023-06-25T05:10:09","modified_gmt":"2023-06-25T09:10:09","slug":"hard-sphere-gas-part-1-theory","status":"publish","type":"post","link":"https:\/\/underthehood.blogwyrm.com\/?p=2083","title":{"rendered":"Hard Sphere Gas &#8211; Part 1: Theory"},"content":{"rendered":"\n<p>This month&#8217;s posting and the next one are meant to serve as both a final act in the simple kinetic theory that has been the focus in recent columns and to provide a prelude for the more in depth Boltzmann distribution theory that follows.&nbsp; Over the past 8 posts, we&#8217;ve explored how simple interactions between constituents of a gas lead to the notion of pressure, help explain the Maxwell-Boltzmann distribution of speeds in the gas at a given temperature, and help us connect measurable, macroscopic features of a material, such a viscosity, to the underlying movement of atoms and molecules.&nbsp; In these final two posts, we&#8217;ll look at hard sphere scattering as the specific particle-to-particle interaction and we&#8217;ll explore how this simple model directly gives rise to the Maxwell-Boltzmann distribution.<\/p>\n\n\n\n<p>This post will present the mechanical aspects of gas of hard spheres confined to a box and how they are reflected off the walls when they hit (leading to pressure) and how they bounce off of each other when they collide.&nbsp; The subsequent post talks about the aspects of making a kinetic theory simulation and presents the results.&nbsp; The discussion presented here is heavily influenced by and expands and tweaks <a href=\"https:\/\/www.glowscript.org\/#\/user\/GlowScriptDemos\/folder\/Examples\/program\/HardSphereGas-VPython\">the very fine simulation by Bruce Sherwood<\/a> in what was originally known as Visual Python and is now part of <a href=\"https:\/\/www.glowscript.org\/\">Glowscript.org<\/a>.<\/p>\n\n\n\n<p>There are three basic ingredients in the hard-sphere gas simulation that will be dealt with in turn: 1) the propagation of a sphere between bounces, 2) the bounce off a wall, and 3) the bounce off each other.<\/p>\n\n\n\n<p>Free propagation of each hard sphere between wall and particle interactions is done via simple rectilinear propagation.&nbsp; Assuming that the initial position and velocity of the sphere is ${\\vec r}_0$ and ${\\vec v}$, then its subsequent location is<\/p>\n\n\n\n<p>\\[ {\\vec r}(t) = {\\vec r}_0 + {\\vec v} \\cdot (t-t_0) \\; . \\]<\/p>\n\n\n\n<p>The velocity remains unchanged until collision with a wall or another hard sphere.<\/p>\n\n\n\n<p>When the atoms reach a wall, they bounce elastically with their normal component of velocity being negated.\u00a0 For example, in the example pictured here,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"776\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_Wall_Bounce.png\" alt=\"\" class=\"wp-image-2082\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_Wall_Bounce.png 723w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_Wall_Bounce-280x300.png 280w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/figure>\n\n\n\n<p>we see a particle approaching a wall in the $y-z$ plane.\u00a0 After the bounce, the $x$-component of the velocity has changed but the transverse components in $y$ and $z$ have not:<\/p>\n\n\n\n<p>\\[\u00a0 {\\vec v} = v_x {\\hat x} + v_y {\\hat y} + v_z {\\hat z} \\; \\rightarrow \\; {\\vec v} = \\, &#8211; v_x {\\hat x} + v_y {\\hat y} + v_z {\\hat z} \\; .\\]<\/p>\n\n\n\n<p>Since time in the simulation elapses in discrete steps, collision with the wall is checked for after each time step.\u00a0 If a component of the particle&#8217;s position puts it beyond the confining box (i.e., it passed through a wall at $x = L$ so that its current $x$-component of position is $x = L + \\delta_x$ ) then that component of the velocity is negated as above and the distance it had traveled beyond the wall is increment to the appropriate component in the opposite direction (i.e., $x = L &#8211; \\delta_x$).<\/p>\n\n\n\n<p>The collision between hard spheres is the most complicated part of this simulation.\u00a0 Like the case with the wall, it will often be the case that at the end of a time step, two particles have their hard body radii $R_1$ and $R_2$ overlapping.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"553\" height=\"746\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_overlapping_spheres.png\" alt=\"\" class=\"wp-image-2080\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_overlapping_spheres.png 553w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_overlapping_spheres-222x300.png 222w\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" \/><\/figure><\/div>\n\n\n\n<p>Once this overlapping end condition is detected, the next step is to determine the time $\\delta t$ to back up such that the spheres are just touching.&nbsp; The algorithm to determine the time step is most easily understood in a frame in which one of the particles, say $m_2$ in blue, is at the center of the coordinate system and the relative velocity vector ${\\vec v} = {\\vec v}_1 &#8211; {\\vec v}_2$ is along the horizontal.&nbsp; Letting ${\\vec r} = {\\vec r}_1 &#8211; {\\vec r}_2$ be the relative position of $m_1$ relative to $m_2$ then the unknown quantity is the vector ${\\vec d}$ between the current relative position and the relative position ${\\vec r}^{\\, *}$ when the two spheres are just touching.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"857\" height=\"267\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_deltat_geometry.png\" alt=\"\" class=\"wp-image-2081\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_deltat_geometry.png 857w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_deltat_geometry-300x93.png 300w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_deltat_geometry-768x239.png 768w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_deltat_geometry-810x252.png 810w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><\/figure><\/div>\n\n\n\n<p>Since ${\\vec r}^* + {\\vec d} = {\\vec r}$ and we know that the length of ${\\vec r}^*$ is $R_1 + R_2 = 2 R$ (i.e., $R$ is the average radius) then a quadratic formula can be developed from<\/p>\n\n\n\n<p>\\[ |{\\vec r}^{\\, *}|^2 = |{\\vec r} &#8211; {\\vec d}|^2 \\; . \\]<\/p>\n\n\n\n<p>After some straightforward algebra, we arrive at<\/p>\n\n\n\n<p>\\[ d^2 &#8211; 2 r \\cos (\\theta) d + (r^2 &#8211; 4R^2) = 0 \\; , \\]<\/p>\n\n\n\n<p>where $d = |{\\vec d}|$, $r = |{\\vec r}|$ and $\\cos (\\theta) = {\\hat r} \\cdot {\\hat V}$, since the relative velocity ${\\vec V}$ is parallel to ${\\vec d}$.<\/p>\n\n\n\n<p>Solving for $d$ yields<\/p>\n\n\n\n<p>\\[ d = r \\cos (\\theta) &#8211; \\sqrt{ 4R^2 + r^2 ( \\cos(\\theta)^2 &#8211; 1 ) } \\; , \\]<\/p>\n\n\n\n<p>where we picked the negative radical because it guarantees $\\delta t$ to be negative signifying that the contact time is in the past as we know it must be.<\/p>\n\n\n\n<p>The final ingredient is to determine how the velocities of the two particles should alter due to their collision.&nbsp; The direction is straightforward as the component of each particle normal to the tangent plane containing their contact must change sign but the magnitude requires a bit more care.<\/p>\n\n\n\n<p>The analysis begins first by calculating the center-of-mass <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"746\" src=\"http:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_center_of_mass_geometry.png\" alt=\"\" class=\"wp-image-2079\" srcset=\"https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_center_of_mass_geometry.png 678w, https:\/\/underthehood.blogwyrm.com\/wp-content\/uploads\/2023\/06\/UTH_06Jun_2023_center_of_mass_geometry-273x300.png 273w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure><\/div>\n\n\n\n<p>via the usual formula<\/p>\n\n\n\n<p>\\[ m_1 {\\vec r}_1 + m_2 {\\vec r}_2 = M {\\vec R} \\; . \\]<\/p>\n\n\n\n<p>Taking a time derivative of this definition<\/p>\n\n\n\n<p>\\[ {\\vec p}_1 + {\\vec p}_2 = {\\vec P}_{tot} = m_1 {\\vec v}_1 + m_2 {\\vec v}_2 = M {\\vec U} \\; \\]<\/p>\n\n\n\n<p>leads to a useful relationship between the center-of-mass kinematics, defined in terms of the total mass $M$ and the velocity of the center-of-mass ${\\vec U}$<\/p>\n\n\n\n<p>\\[ {\\vec U} = \\frac{ {\\vec P}_{tot} }{M} \\; .\\]<\/p>\n\n\n\n<p>The next step is finding the positions, ${\\vec \\rho}_i$, of both masses relative to the center-of-mass using&nbsp; ${\\vec R} + {\\vec \\rho}_i = {\\vec r}_i $ to yield<\/p>\n\n\n\n<p>\\[ {\\vec \\rho}_i = {\\vec r}_i &#8211; {\\vec R} \\; . \\]<\/p>\n\n\n\n<p>Multiplying by $m_i$, taking the time derivative, and defining the momentum of each mass relative to the center-of-mass as ${\\vec \\pi}_i = m_i \\frac{d}{dt} {\\vec \\rho}_i$ gives the expression<\/p>\n\n\n\n<p>\\[ {\\vec \\pi}_i = {\\vec p}_i &#8211; m_i {\\vec U} = {\\vec p}_i &#8211; m_i \\frac{{\\vec P}_{tot}}{M} \\; , \\]<\/p>\n\n\n\n<p>where the last equality follows from the earlier relationship between the total momentum and the velocity of the center-of-mass.<\/p>\n\n\n\n<p>The physical interpretation of the ${\\vec \\pi}_i$ is most clearly revealed by summing them<\/p>\n\n\n\n<p>\\[ {\\vec \\pi}_1 + {\\vec \\pi}_2 = {\\vec p}_1 &#8211; m_1 \\frac{{\\vec P}_{tot}}{M} + {\\vec p}_2 &#8211; m_2 \\frac{{\\vec P}_{tot}}{M} \\\\ = ({\\vec p}_1 + {\\vec p}_2) &#8211; (m_1 + m_2) \\frac{{\\vec P}_{tot}}{M} = 0 \\; .\\]<\/p>\n\n\n\n<p>This relation and the one before supply the physical interpretation for the ${\\vec \\pi}$\u2019s:&nbsp; they are the momenta of each particle in a coordinate frame comoving with the center of mass (i.e., relative to the center-of-mass).&nbsp; The Galilean transform that affects this result is said to have transformed the momenta (or velocity) into the center-of-momentum frame.<\/p>\n\n\n\n<p>The application of the on-contact bounce is trivial in this frame.&nbsp; The total change in momentum is done only in the direction parallel to the line joining the two masses (i.e., normal to the tangent plane containing the contact)<\/p>\n\n\n\n<p>\\[ \\Delta {\\vec p} = ({\\vec \\pi}_i \\cdot {\\hat \\rho}_i ) {\\hat \\rho}_i \\; \\]<\/p>\n\n\n\n<p>and must be equal and opposite for each particle.<\/p>\n\n\n\n<p>Each of the ${\\vec \\pi}_i$ changes to its after bounce value ${\\vec \\pi}&#8217;_i$ according to<\/p>\n\n\n\n<p>\\[ {\\vec \\pi}&#8217;_i = {\\vec \\pi}_i &#8211; 2 \\Delta {\\vec p} \\; .\\]<\/p>\n\n\n\n<p>The change in velocity is then found by first reversing the transformation to get ${\\vec p}&#8217;_i$ via<\/p>\n\n\n\n<p>\\[ {\\vec p}&#8217;_i = {\\vec \\pi}&#8217;_i + m_i \\frac{{\\vec P}_{tot}}{M} \\; , \\]<\/p>\n\n\n\n<p>from which immediately follows<\/p>\n\n\n\n<p>\\[ {\\vec v}&#8217;_i = {\\vec p}&#8217;_i \/ m_i \\; . \\]<\/p>\n\n\n\n<p>Next month\u2019s column covers the details of how these theoretical results are translated into a simulation and explores the results.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This month&#8217;s posting and the next one are meant to serve as both a final act in the simple kinetic theory that has been the focus in recent columns and&#8230; <a class=\"read-more-button\" href=\"https:\/\/underthehood.blogwyrm.com\/?p=2083\">Read more &gt;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2083","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/2083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2083"}],"version-history":[{"count":7,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/2083\/revisions"}],"predecessor-version":[{"id":2090,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/2083\/revisions\/2090"}],"wp:attachment":[{"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/underthehood.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}