


{"id":346674,"date":"2024-01-25T19:00:08","date_gmt":"2024-01-25T19:00:08","guid":{"rendered":"\/forum\/?post_type=topic&#038;p=346674"},"modified":"2024-01-25T19:00:08","modified_gmt":"2024-01-25T19:00:08","slug":"rpsetvar-not-working-for-materials","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/rpsetvar-not-working-for-materials\/","title":{"rendered":"rpsetvar not working for materials"},"content":{"rendered":"<p>Hello,<\/p>\n<p><strong>Background:<\/strong> I have a large chemical reaction mechanism running in 2D Fluent. It consists of 24 reactions and 17 species. I am looking to do sensitivity studies, where I turn off a reaction, then re-run to get its contribution to the results.<\/p>\n<p>I previously tried deactiviting specific reactions in the mechanism be de-selecting them. However, for reasons unknown, that did not actually deactivate them. A sure way to deactivate is to set the pre-exponential factor to a small fraction of its original value, say, two orders of magniutude lower. This effectively turns off the reaction.<\/p>\n<p>Now to the issue. Doing this with the GUI is painful, so I am doing it with scheme commands.&nbsp;<\/p>\n<p><strong>Problem<\/strong>: The (rpsetvar &#8216;materials mymaterials) does not actually update the materials database or the GUI.&nbsp;<\/p>\n<p><strong>Possible Solution<\/strong>: By searching through this document [https:\/\/www.cfdyna.com\/CFDHT\/SchemeLanguage.pdf], I found a command called set-all-materials!. This one actually works and updates the GUI values.<\/p>\n<p><strong>Question<\/strong>: Does anyone know why <em>rpsetvar <\/em>doesn&#8217;t work? Also, does an easier way to update kinetic parameters exist (non-GUI)?<\/p>\n<p>Thanks.<\/p>\n<p>BTW, here is my workflow:<\/p>\n<pre style=\"padding-left: 80px\">(define mat (%rpgetvar 'materials))<br><br>(define mymaterials (replace mat 1.5e+14 1.5e+12))<br><br>(set-all-materials! mymaterials)<\/pre>\n<p>where &#8220;replace&#8221; is a scheme procedure I found online:<\/p>\n<pre style=\"padding-left: 120px\">(define (replace lst find repl)<br>&nbsp; &nbsp; (if (pair? lst)<br>&nbsp; &nbsp; &nbsp; &nbsp; (cons<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (replace (car lst) find repl)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (replace (cdr lst) find repl))<br>&nbsp; &nbsp; &nbsp; &nbsp; (if (equal? find lst)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; repl<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lst)))<\/pre>\n","protected":false},"template":"","class_list":["post-346674","topic","type-topic","status-closed","hentry","topic-tag-chemical-reaction","topic-tag-fluent","topic-tag-materials","topic-tag-scheme","topic-tag-scheme-procedure"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":["23.206.193.154"],"_bbp_subscription":["198499","15977"],"_btv_view_count":["330"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["346674"],"_bbp_forum_id":["27792"],"_bbp_engagement":["15977","198499"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["348611"],"_bbp_last_active_id":["348611"],"_bbp_last_active_time":["2024-02-02 15:04:17"]},"test":"81822989103acf04149ecc1e8ee93667329b3f17"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/346674","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":1,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/346674\/revisions"}],"predecessor-version":[{"id":346675,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/346674\/revisions\/346675"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=346674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}