


{"id":390035,"date":"2024-10-16T13:41:37","date_gmt":"2024-10-16T13:41:37","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/segmentation-fault-using-f_flux-in-define_dpm_source\/"},"modified":"2024-10-16T13:41:37","modified_gmt":"2024-10-16T13:41:37","slug":"segmentation-fault-using-f_flux-in-define_dpm_source","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/segmentation-fault-using-f_flux-in-define_dpm_source\/","title":{"rendered":"Segmentation fault using F_FLUX in DEFINE_DPM_SOURCE"},"content":{"rendered":"<p>&lt;p&gt;Hi there,&lt;\/p&gt;&lt;p&gt;I have a UDF that defines particle source terms in Fluent 17 using DEFINE_DPM_SOURCE with the pressure-based solver.&lt;\/p&gt;&lt;p&gt;I need to get the mass flow into the cell containing the particle for this calculation.&lt;\/p&gt;&lt;p&gt;I tried using F_FLUX but I keep getting a segmentation fault error, is the mass flow not stored for faces of cells?&lt;\/p&gt;&lt;p&gt;The relevant code that causes the crash (if I remove the &#8220;f_flow = F_FLUX(f,f_t);&#8221; line it doesn&#8217;t crash):&lt;\/p&gt;&lt;p&gt;DEFINE_DPM_SOURCE(Source, c, t, S, strength, p)&lt;br&gt;{&lt;br&gt;&nbsp; &nbsp; Thread*f_t;&lt;br&gt;&nbsp; &nbsp; face_t f;&lt;br&gt;&nbsp; &nbsp; int n;&lt;br&gt;&nbsp; &nbsp; real f_flow;&lt;br&gt;&nbsp; &nbsp;&nbsp;&lt;br&gt;&nbsp; &nbsp; c_face_loop(c, t, n)&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; {&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f = C_FACE(c,t,n);&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f_t = C_FACE_THREAD(c,t,n);&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f_flow = F_FLUX(f,f_t);&lt;br&gt;&nbsp; &nbsp; }&lt;br&gt;}&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-390035","topic","type-topic","status-publish","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["470943","199"],"_bbp_author_ip":["130.232.81.52"],"_btv_view_count":["112"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["390035"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","470943"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["390055"],"_bbp_last_active_id":["390055"],"_bbp_last_active_time":["2024-10-16 14:47:16"]},"test":"psantochabo-fi"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/390035","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\/390035\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=390035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}