{"id":173,"date":"2019-02-23T17:11:19","date_gmt":"2019-02-23T16:11:19","guid":{"rendered":"https:\/\/thetheoreticaldiver.org\/wordpress\/?p=173"},"modified":"2019-12-12T13:59:08","modified_gmt":"2019-12-12T12:59:08","slug":"equalizing-real-gases","status":"publish","type":"post","link":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/2019\/02\/23\/equalizing-real-gases\/","title":{"rendered":"Equalizing real gases"},"content":{"rendered":"\n<p>As for filling cylinders <a href=\"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/2017\/11\/02\/when-real-gas-corrections-matter\/\">real gas corrections do matter<\/a>, we try to take the compressibility factor into account in Subsurface. As the theoretical physicist I thought (as I was taught) this is handled by the van der Waals equations. Turns out, in the pressure\/temperature range relevant for diving cylinders is very far from getting the corrections to the ideal gas equations right. There are errors at least in the 30% range. This is probably since we are quite far away from the tri-critical point where it is supposed to be a good approximation. <\/p>\n\n\n\n<p>In the end, we found a cubic approximation with coefficients read off from  tables of compressibility factors to be an economic way to do these computations. You can find the source <a href=\"https:\/\/github.com\/Subsurface-divelog\/subsurface\/blob\/master\/core\/gas-model.c\">here<\/a>.<\/p>\n\n\n\n<p>When today somebody asked in a diving forum for a spreadsheet to calculate the resulting pressure when streaming between two cylinders, I thought I could use these interpolations to do the calculations for real gases with different compositions. <a href=\"https:\/\/thetheoreticaldiver.org\/~robert\/gasmixing.ods\">Here<\/a> is what I came up with.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As for filling cylinders real gas corrections do matter, we try to take the compressibility factor into account in Subsurface. As the theoretical physicist I thought (as I was taught) this is handled by the van der Waals equations. Turns out, in the pressure\/temperature range relevant for diving cylinders is very far from getting the &hellip; <a href=\"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/2019\/02\/23\/equalizing-real-gases\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Equalizing real gases&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[1],"tags":[6],"coauthors":[],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-real-gas"],"_links":{"self":[{"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":1,"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/173\/revisions\/174"}],"wp:attachment":[{"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=173"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/thetheoreticaldiver.org\/wordpress\/index.php\/wp-json\/wp\/v2\/coauthors?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}