Fluids

Fluids

Segmentation Fault while Executing an UDF

    • steppenwolf
      Subscriber
      Hi,nWhile I run a UDF in serial, I get an error like:nError: received a fatal signal (Segmentation fault) ...nThe UDF I try to execute looks like:n#include udf.hn#include mem.hn#define VAR_NAME SOME_VALUE;nenumn{npar1,npar2,n...n};nDEFINE_ON_DEMAND(SOME_NAME);nDomain *domain=Get_Domain(ROOT_DOMAIN_ID);ncell_t c;nThread *t;nthread_loop_c(t,domain)n{nbegin_c_loop(c,t)n{nC_UDSI(c,t,par1)=C_SOME_VARIABLE(c,t)+...;nC_UDSI(c,t,par2)=C_UDSI(c,t,par2)+C_SOME_VARIABLE(c,t)+...;nMessage(.....,C_UDSI(c,t,par2);n}nend_c_loop(c,t)n}n}nSo, does this error imply that I should UDM or I cannot reach the related variables or something else?nIf I should use UDM, can you give some tips as the starting point?nIf it is a matter of reaching the variable, can it be due to the spatial discretization scheme I use (Green Gauss Node based)?nThanksnn
    • DrAmine
      Ansys Employee
      Might be access violation. Have you defined in Fluent the UDS's and UDM's?n
    • steppenwolf
      Subscriber
      No, I did not defined any UDM's and UDS's are defined as seen from the UDF I provided above. Is something missing for a proper definition of UDS?nThanksn
    • Rob
      Ansys Employee
      Did you switch on the UDM and UDS in Fluent? nnWhen you compile the code the scalar & memory you're requesting needs to have somewhere to go. n
Viewing 3 reply threads
  • You must be logged in to reply to this topic.