Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Segmentation Fault error object #f

    • Abbasraza20000220
      Subscriber

      Hello to all.

      I have been uploading UDF for defining hot stream in the fluid which is air. I am trying to compile the UDF. UDF is compiled without any error. On running the simulation, its giving error as attached in the screenshot. Seniors please help me. Why this error comes?

      Regards,

      Abbas Raza

    • Konstantin
      Ansys Employee
      SIGSEGV is invalid memory access, i. e attempt to accessing memory that is not been initialized or attempting to accessing out of array bounds. have you tried debugging the UDF e. g. by commenting out lines to pinpoint which syntax construct leads to SIGSEGV? I also see you are interpreting the UDF, however not all UDF macros are compatible with interpreter option. n
    • Abbasraza20000220
      Subscriber
      Sorry I could not get about SIGSEGV. I interpreted and checked it by compiling separately but the result is same. How I can debug my UDF? I checked on internet they are saying different reasons. when when udf could not access variable. nPlease have a look in my udf.n#include udf.hn#include prop.hn#include sg.hn#include mem.hnDEFINE_PROFILE(mfm_h, thread, position)n{n double mh, mc, fh, fc;n real x[ND_ND];n face_t f;n Thread *t0, *t1;n cell_t c0, c1;n begin_f_loop(f, thread)n {n c0 = F_C0(f, thread);n t0 = THREAD_T0(thread);n c1 = F_C1(f, thread);n t1 = THREAD_T1(thread);n  fh = C_YI(c0, t0, 0);n  fc = C_YI(c1, t1, 0);n  mh = fh*0.95;n  mc = fc+fh-mh;n F_PROFILE(f, thread, position)= mh;n }n end_f_loop(f, thread)n}Regards,nAbbas n
    • Konstantin
      Ansys Employee
      start commenting out the lines, compiling again and running to see which one leads to the error. Are you hooking the UDF to a two-sided boundary where t1 and c1 can be accessed?n
    • Abbasraza20000220
      Subscriber
      yes, when I removed C1 and T1, its working. its mean this macro is not for c1 & t1?nRegards,nAbbasn
    • Konstantin
      Ansys Employee
      Please refer to Sec. 3.2.5. Connectivity Macros of Fluent customization manual which discussed F_C0 and F_C1. It'll clarify for you that c0 always exists for a face, but c1 may or may not exist. For example for an exterior face, e. g. a face on an external boundary like inlet, c1 doesn't exist. n
    • Abbasraza20000220
      Subscriber
      I am thankful from the depth of heat for your support.nRegards,nAbbas Razan
Viewing 6 reply threads
  • The topic ‘Segmentation Fault error object #f’ is closed to new replies.
[bingo_chatbox]