


{"id":34890,"date":"2019-04-23T12:28:51","date_gmt":"2019-04-23T12:28:51","guid":{"rendered":"\/forum\/forums\/topic\/changing-boundary-condition\/"},"modified":"2019-04-23T12:28:51","modified_gmt":"2019-04-23T12:28:51","slug":"changing-boundary-condition","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/changing-boundary-condition\/","title":{"rendered":"Changing boundary condition"},"content":{"rendered":"<p>Hi,<\/p>\n<p><\/p>\n<p>I have a transient simulation and I want to change the boundary condition from Mass Flow Outlet to Pressure Outlet when a limit value of pressure in a cell zone is reached.<\/p>\n<p><\/p>\n<p>I have already written a Scheme-File for changing a boundary condition as function of time but not as function of a value.<\/p>\n<p><\/p>\n<p>I have read this in order to change the BC.<\/p>\n<p><\/p>\n<p>&nbsp; &#8211; You need a RP Variable<\/p>\n<p><\/p>\n<p>&nbsp; &#8211;&nbsp; You need an UDF to set that variable to True or False \/ 1 or 0 depending of the condition<\/p>\n<p><\/p>\n<p>&nbsp; &#8211; You need then a calculation activity which checks for that variable and change the boundary condition<\/p>\n<p><\/p>\n<p>&nbsp; &#8211; You need another UDF to adjust the boundary if RP Varriable is true or 1..<\/p>\n<p><\/p>\n<p>&nbsp;<\/p>\n<p><\/p>\n<p>I have created the following Scheme for defining a RP Variable named &#8220;reached&#8221;, which defines if the pressure at the outlet is reached or not.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/us.v-cdn.net\/6032193\/uploads\/attachments\/d652d665-7f9c-42a4-8f4c-a96d00d34316\/23e39d32-c322-419c-a885-aa3800d455de_rp.jpg?width=690&amp;upscale=false\" alt=\"\"><\/p>\n<p><\/p>\n<p>&nbsp;In a UDF i have to set the variable to True or False depending on the condition. In a UDF I can access the value of the RP Variable by using RP_Get_Integer. I have seen that I can change the value of the variable by using rpsetvar in the Text Interface. For the UDF, can I use RP_Set_Variable(&#8220;&#8230;&#8221;, int)?<\/p>\n<p><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/us.v-cdn.net\/6032193\/uploads\/attachments\/d652d665-7f9c-42a4-8f4c-a96d00d34316\/a6dec03b-2f57-45e3-835d-aa3800d5cbd6_get.jpg?width=690&amp;upscale=false\" alt=\"\"><\/p>\n<p><\/p>\n<p>Moreoever how can I access the pressure at the outlet for defining the UDF? I think that I have to use the ID number of the face and the face macro F_P(f, t). Is it right?<\/p>\n<p><\/p>\n<p>&nbsp;<\/p>\n<p><\/p>\n<p>Regards,<\/p>\n<p><\/p>\n<p>Maxime<\/p>\n","protected":false},"template":"","class_list":["post-34890","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_old_topic_id":["7062"],"_bbp_old_topic_author_name_id":["Anonymous"],"_bbp_old_is_topic_anonymous_id":["false"],"_bbp_old_closed_status_id":["publish"],"_bbp_author_ip":[null],"_bbp_old_sticky_status_id":["normal"],"_bbp_likes_count":["0","0"],"_btv_view_count":["2097"],"_bbp_subscription":["237203"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["34890"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","22555","159144"],"_bbp_voice_count":["3"],"_bbp_reply_count":["22"],"_bbp_last_reply_id":["83831"],"_bbp_last_active_id":["83831"],"_bbp_last_active_time":["2019-04-26 07:23:48"]},"test":"max4"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/34890","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\/34890\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=34890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}