Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF error: member reference base type ‘void’ is not a structure or union

    • Neel Shah
      Subscriber

      Hi there,

      I've run into a repeated error when attempting to compile UDF using Ansys 2023 R2 Fluent's built in compiler Clang. The code has been sourced from Sandia Gov and error message in Ansys when compiling is as the following:

      uvdose_par.c(42,50): error: member reference base type 'void' is not a structure or union
      par_fprintf_head(fp,"(%s %d)\n",thread->head->dpm_summary.sort_file_name,14);

      It seems to indicate that line " par_fprintf_head(fp,"(%s %d)\n",thread->head->dpm_summary.sort_file_name,14);" of my code below has a problem. Here is part of the code of concern:

      if (header)
      {
      if (NNULLP(thread))
      par_fprintf_head(fp,"(%s %d)\n",thread->head->dpm_summary.sort_file_name,14);
      else
      par_fprintf_head(fp,"(%s %d)\n",plane->sort_file_name,14);

      par_fprintf_head(fp,"(%10s %10s %10s %10s %10s %10s %10s"
      " %10s %10s %10s %10s %10s %10s %10s %s)\n",
      "X0","Y0","Z0",
      "X","Y","Z","U","V","W","diameter","T","mass-flow",
      "time","UV-Dosage","name");
      }

      I've had a talk with the individual who made this code, yet they have only mentioned to me that "The UDF was developed by Sandia based on the version of Fluent available in 2008. Ansys made some changes to their libraries when they changed HPC licensing. You’ll have to update the UDF to run on the current version of fluent".

      I've tried and searched for weeks to solve this error yet have been unable to do so. My deadline to utilize this UDF is soon approaching, and was hoping if anybody is able to help. I would sincerely appreciate it if someone could attempt to help me solve this issue or even reply!

      Thank you so much for your precious time.

      Kind regards,
      Niall

    • Rob
      Forum Moderator

      How does it all compare to the DPM Summary example and  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/flu_udf/flu_udf_sec_in_out_macros.html%23flu_udf_sec_par_fprintf_macros  ?

      • Neel Shah
        Subscriber

        Hi there,

        Could you please elaborate what you mean by DPM summary example. As for the the Ansys Customer Support Space Registration Form, I don't believe I can get access to this in the relevant period of time. 

        As an update, the error message seems to be a result of the change in version of ANSYS Fluent being used (due to changes in the Fluent API between 2008 and 2023 versions). Any possible help regarding how to update the aforementioned part of the code would truly be appreciated! Many thanks for your time. 

        Kind regards,

        Niall

         

    • Rob
      Forum Moderator

      Click on Help in Fluent and paste the link into the browser, that should bypass the security. Have a look for the macro in that version of DOC and see what's changed. Unlike commercial support (which is export checked) we're very limited as the Community Forum is "public" from an export compliance point of view. 

      • Neel Shah
        Subscriber

        Hi Rob,

        Despite my efforts to troubleshoot this issue, I'm consistently prompted for the customer number, and I haven't been successful in bypassing it. Following advice from an Ansys employee within our organization, I've posted on another forum for assistance. However, I'm exploring alternative methods to locate the macro in the current version of Ansys and identify any changes relevant to UDF updates. Accessing the release notes seems promising for resolving this error:

        uvdose_par.c(42,50): error: member reference base type 'void' is not a structure or union
        par_fprintf_head(fp,"(%s %d)\n",thread->head->dpm_summary.sort_file_name,14);

        Any guidance you can provide would be greatly appreciated. Thank you for your ongoing support and consideration.

    • Rob
      Forum Moderator

      Clicking on Help in the solver should get you to the Help system. Please confirm that's what you're doing. 

      • Neel Shah
        Subscriber

        Hi Rob,

        I selected the Help Button (in Fluent solver in the upper-right corner) > Learning Resources > Fluent Release Notes and get redirected to Internet Explorer where it asks for my login. At this stage I copied the URL and pasted it into another browser yet after logging in it redirects me to the Ansys Customer Support Space Registration Form. Am I doing something incorrect in this procedure? 

        Once again thank you for your help. 

    • Rob
      Forum Moderator

      Try Help>User's Guide    

      • Neel Shah
        Subscriber

        Hi Rob,

        In that case I get the following error in my console window:

    • Neel Shah
      Subscriber

      Hi Rob,

      In that case I get the following error in my console window:

    • Rob
      Forum Moderator

      I assume the computer can see the internet? I'll get Install to have a look. Was anything printed above the error?

      • Neel Shah
        Subscriber

        Hi Rob,

        Yes the following was printed above that initial error:

    • Rob
      Forum Moderator

      That may need some help from IT - Fluent needs to be able to see the internet and trigger a browser to open. 

Viewing 7 reply threads
  • The topic ‘UDF error: member reference base type ‘void’ is not a structure or union’ is closed to new replies.