


{"id":45812,"date":"2020-07-05T08:22:27","date_gmt":"2020-07-05T08:22:27","guid":{"rendered":"\/forum\/forums\/topic\/udf-to-calculate-the-radiation-intensity-on-dpm-particles\/"},"modified":"2020-07-05T08:22:27","modified_gmt":"2020-07-05T08:22:27","slug":"udf-to-calculate-the-radiation-intensity-on-dpm-particles","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/udf-to-calculate-the-radiation-intensity-on-dpm-particles\/","title":{"rendered":"UDF to calculate the radiation intensity on dpm particles"},"content":{"rendered":"<p>Hi Guyz,<\/p>\n<p><\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am trying to calculate the intensity of DO radiation on the dpm particles that are injected from inlet along the trajectories. For that reason I used below mentioned udf in which irradiation(W\/m2) in before the timestep started and irradiation after the time step is completed is used with trapezoidal rule to integrate the intensity (j\/m2)<\/p>\n<p><\/p>\n<p>#include &#8220;udf.h&#8221;<br \/>#include &#8220;dpm.h&#8221;<\/p>\n<p>&nbsp;DEFINE_INIT(rad_init,domain)<br \/>&nbsp;{<br \/>&nbsp;\/* if memory for the particle variable titles has not been<br \/>&nbsp;* allocated yet, do it now *\/<br \/>&nbsp;if (NULLP(user_particle_vars)) Init_User_Particle_Vars();<br \/>&nbsp;\/* now set the name and label *\/<br \/>&nbsp;strcpy(user_particle_vars[0].name,&#8221;rad_virus&#8221;);<br \/>&nbsp;strcpy(user_particle_vars[0].label,&#8221;Rad Virus&#8221;);<br \/>&nbsp;strcpy(user_particle_vars[1].name,&#8221;rad_virus-0&#8243;);<br \/>&nbsp;strcpy(user_particle_vars[1].label,&#8221;Rad Virus 0&#8243;);<br \/>&nbsp;}<\/p>\n<p>&nbsp;DEFINE_DPM_SCALAR_UPDATE(rad_virus,cell,thread,initialize,tp)<br \/>{<br \/>&nbsp; Injection *I;<br \/>&nbsp; Particle *p;<br \/>&nbsp; cell_t c;<br \/>&nbsp; Thread *t;<br \/>&nbsp;if (initialize)<br \/>&nbsp;{<br \/>&nbsp;TP_USER_REAL(tp,0) = 0.;<br \/>&nbsp;TP_USER_REAL(tp,1) = c-&gt;DO_IRRAD;<br \/>&nbsp;}<\/p>\n<p>&nbsp;else<br \/>&nbsp;{<br \/>&nbsp;\/* use a trapezoidal rule to integrate the melting index *\/<br \/>&nbsp;TP_USER_REAL(tp,0) += 0.001 * .5 * (TP_USER_REAL(tp,1) + c-&gt;DO_IRRAD);<br \/>&nbsp;\/* save current fluid viscosity for start of next step *\/ <br \/>&nbsp;TP_USER_REAL(tp,1) = c-&gt;DO_IRRAD;<br \/>&nbsp;}<br \/>&nbsp;}<\/p>\n<p><\/p>\n<p>But it is throwing error C2223: left of &#8216;-&gt;DO_IRRAD&#8217; must point to struct\/union<\/p>\n<p><\/p>\n<p>Please Help<\/p>\n","protected":false},"template":"","class_list":["post-45812","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_old_topic_id":["17994"],"_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"],"_btv_view_count":["460"],"_bbp_subscription":["243270"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["45812"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","67118"],"_bbp_voice_count":["2"],"_bbp_reply_count":["4"],"_bbp_last_reply_id":["120323"],"_bbp_last_active_id":["120323"],"_bbp_last_active_time":["2020-07-06 15:47:47"]},"test":"pavankonchada334"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/45812","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\/45812\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=45812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}