


{"id":163175,"date":"2021-10-18T14:33:47","date_gmt":"2021-10-18T14:33:47","guid":{"rendered":"\/forum\/forums\/topic\/udf-ideal-gas-law-for-density\/"},"modified":"2021-10-19T12:12:20","modified_gmt":"2021-10-19T12:12:20","slug":"udf-ideal-gas-law-for-density","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/udf-ideal-gas-law-for-density\/","title":{"rendered":"UDF Ideal Gas Law for Density"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>My current goal is for the sake of practicing <strong>&ldquo;UDF Define properties&rdquo;,<\/strong> is to mimic Fluent ideal gas law by writing my own ideal gas UDF&nbsp;and comparing it with fluent Ideal gas version.<\/p>\n<p>For the UDF and non-UDF ideal gas, the energy equation is on. I am using the same Mesh, case model, and boundary condition for both! (inlet velocity=50m\/s, k-e Standart Model, I am using CO2 as a gas, pressure based) The only difference is how the density and speed of sound are defined for the 1st case I choose the ideal gas for density which is provided from Fluent there (in the Material property window) you don&#039;t need to define the speed of sound.<\/p>\n<p>For my 2nd case, I wrote my own ideal gas equation and ideal gas speed of sound calculation which are set in fluent for the density and speed of sound (UDF) in the same material property window. (you need to compile the code&#8230;.)<\/p>\n<p>Now we should expect to get similar results for both simulations right! But not so fast! Please check the unexpected results I had below!<\/p>\n<p>My 2d tunnel has a circle inside ( so we have a flow over a sphere in 2D), at stagnation I expect the static temperature to increase which was true for Fluent ideal gas but not my UDF ideal gas, my cell temperature contour I should expect to get similar results which wasn&rsquo;t the case for the temperature. (static and Total). Specifically, the static temperature remained constant everywhere unlike the fluent version which varies which is the right behavior\/result.<\/p>\n<p>So why is this happening?? is the energy equation not computed? although it is on? <\/p>\n<p>I am pretty sure that my ideal gas written UDF equation is right since I monitored the numbers of T and P and got the same answer with my calculator. For me at first sight it looks like the energy equation is not computed?<\/p>\n<p>I expet Fluent is caling my Defined properties after he solves the momentum, energy, transport equation, like the below skematic table that I retrieved from the UDF manual of Fluent.<\/p>\n<div class=\"embedExternal embedImage\">\n<div class=\"embedExternal-content\">\n<a class=\"embedImage-link\" href=\"\/forum\/wp-content\/uploads\/forum-uploads\/269\/CW7ZRQ4W6UIR.png\" rel=\"nofollow noopener\" target=\"_blank\"><br \/>\n<img decoding=\"async\" class=\"embedImage-img\" src=\"\/forum\/wp-content\/uploads\/forum-uploads\/269\/CW7ZRQ4W6UIR.png\" alt=\"image.png\" \/><br \/>\n<\/a><\/p>\n","protected":false},"template":"","class_list":["post-163175","topic","type-topic","status-closed","hentry","topic-tag-density","topic-tag-equation-of-state","topic-tag-ideal-gas","topic-tag-udf-fluent"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":[""],"_bbp_old_reply_author_name_id":["Anonymous"],"_bbp_old_is_reply_anonymous_id":["false"],"_btv_view_count":["2026"],"_bbp_likes_count":["0"],"_bbp_subscription":["234230","172158","199"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["163175"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","172158","234230"],"_bbp_voice_count":["3"],"_bbp_reply_count":["8"],"_bbp_last_reply_id":["292274"],"_bbp_last_active_id":["292274"],"_bbp_last_active_time":["2023-07-10 10:53:49"]},"test":"avedis-tchamitchiantum-de"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/163175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/163175\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=163175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}