


{"id":284150,"date":"2023-05-16T07:19:53","date_gmt":"2023-05-16T07:19:53","guid":{"rendered":"\/forum\/forums\/topic\/wind-profiles\/"},"modified":"2023-05-16T07:19:53","modified_gmt":"2023-05-16T07:19:53","slug":"wind-profiles","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/wind-profiles\/","title":{"rendered":"Wind profiles"},"content":{"rendered":"<p>Hi everyone,<\/p>\n<p>I used the UDF file for the Wind direction and speed in transient mode. But the result looks not true while the upper wind speed is much slower than the building surrounding.&nbsp; Below is my script for the UDF.<\/p>\n<p>Looking forward for your suggestions.<\/p>\n<p>Thanks a lot<\/p>\n<p><img decoding=\"async\" src=\"\/forum\/wp-content\/uploads\/sites\/2\/2023\/05\/16-05-2023-1684221313-Screenshot 2023-05-16 151424.jpg\" alt=\"\"><\/p>\n<div>\n<div>#include &#8220;udf.h&#8221;<\/div>\n<p><\/p>\n<div>DEFINE_PROFILE(velocity,t,i)<\/div>\n<div>{<\/div>\n<p><\/p>\n<div>&nbsp; face_t f;<\/div>\n<div>&nbsp; real flow_time;<\/div>\n<div>&nbsp; flow_time=RP_Get_Real(&#8220;flow-time&#8221;);<\/div>\n<div>&nbsp; real x[ND_ND];<\/div>\n<div>&nbsp; real z;<\/div>\n<p><\/p>\n<div>&nbsp; if(flow_time &gt;=0 &amp;&amp; flow_time &lt; 3600){<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; &nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(1-1)*flow_time\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;=3600 &amp;&amp; flow_time &lt; 7200){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-3600)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 7200 &amp;&amp; flow_time &lt; 10800){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-7200)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 10800 &amp;&amp; flow_time &lt; 14400){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(1.6-1)*(flow_time-10800)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 14400 &amp;&amp; flow_time &lt; 18000){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1.6+(1.9-1)*(flow_time-14400)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 18000 &amp;&amp; flow_time &lt; 21600){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1.9+(1-1.9)*(flow_time-18000)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 21600 &amp;&amp; flow_time &lt; 25200){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(2.5-1)*(flow_time-21600)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 25200 &amp;&amp; flow_time &lt; 28800){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (2.5+(4.1-2.5)*(flow_time-25200)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.14);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 28800 &amp;&amp; flow_time &lt; 32400){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (4.1+(3.1-4.1)*(flow_time-28800)\/3600)*pow(270\/10,0.22)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 32400 &amp;&amp; flow_time &lt; 36000){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (3.1+(1.8-3.1)*(flow_time-32400)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 36000 &amp;&amp; flow_time &lt; 39600){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1.8+(1-1.8)*(flow_time-36000)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 39600 &amp;&amp; flow_time &lt; 43200){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(1.6-1)*(flow_time-39600)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.14);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 43200 &amp;&amp; flow_time &lt; 46800){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1.6+(1-1)*(flow_time-43200)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 46800 &amp;&amp; flow_time &lt; 50400){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-46800)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; if(flow_time &gt;= 50400 &amp;&amp; flow_time &lt; 54000){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-50400)\/3600)*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp; &nbsp;if(flow_time == 54000){ &nbsp; &nbsp;<\/div>\n<div>&nbsp; &nbsp; begin_f_loop(f,t)<\/div>\n<div>&nbsp; &nbsp; {<\/div>\n<div>&nbsp; F_CENTROID(x,f,t);<\/div>\n<div>&nbsp; &nbsp; z=x[2];<\/div>\n<div>&nbsp; &nbsp; F_PROFILE(f,t,i) = 1*pow(270\/10,0.14)*pow(z\/370,0.22);<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; end_f_loop(f,t)<\/div>\n<div>&nbsp; }<\/div>\n<div>&nbsp;<\/div>\n<p><\/p>\n<div>}<\/div>\n<\/div>\n","protected":false},"template":"","class_list":["post-284150","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["284591","199"],"_bbp_author_ip":["23.39.172.22"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["508"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["284150"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","284591"],"_bbp_voice_count":["2"],"_bbp_reply_count":["5"],"_bbp_last_reply_id":["284454"],"_bbp_last_active_id":["284454"],"_bbp_last_active_time":["2023-05-17 13:07:56"]},"test":"anhvukdgmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/284150","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\/284150\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=284150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}