Fluids

Fluids

udf_names.c Error

    • Jeroen
      Subscriber

      Hello


       


      I am trying to compile my UDF of type DEFINE_DPM_HEAT_MASS() and it seems to be free of errors and warnings. However, during compiling and building the library I get an error whilst udf_names.c is generated by ANSYS (see below). I opened this file and it specifically states to not make any changes to it. 


       


      How come I get this error and how can I solve it?


       


       


      Copied C:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSReact_Hematite.c to libudfsrc


      udf_names.c and user_nt.udf files in 3d are upto date.


      (system "copy "C:PROGRA~1ANSYSI~1v195fluent"fluent19.5.0srcudfmakefile_nt.udf "libudfwin643dmakefile" ")


      1 file(s) copied.


      (chdir "libudf")(chdir "win643d")udf_names.c


      udf_names.c(7): error C2059: syntax error: '}'


      udf_names.c(8): warning C4034: sizeof returns 0


       


       


      Done.


       


       


      Kind regards,


      Jeroen

    • DrAmine
      Ansys Employee
      Check if white spaces are there and udf name. All arguments to be put on the same line
    • Jeroen
      Subscriber

      My function declaration is as follows:


       


      DEFINE_DPM_HEAT_MASS(hematite,p,Cp,hgas,hvap,cvap_surf,Z,dydt,dzdt)


      {


        ...


      }


      There are no whitespaces and all arguments are on the same line.

    • DrAmine
      Ansys Employee
      And the right bracket,,? What happens if you just copy the example from Manual,?
    • Jeroen
      Subscriber

      I have tried to run a UDF code that was sent to me in a previous question I asked on this forum. However this gives the exact same error.


      There is also no whitespace before or after the closing bracket in my code.

    • DrAmine
      Ansys Employee
      Try the one from manual and let me know before that try a simple Hello World On demand UDF.
    • Jeroen
      Subscriber

      For both the code provided in the manual and a simple Hello World On Demand UDF i get the same error.


      The code I use for the Hello World UDF is as follows:


       


      #include "udf.h"


      DEFINE_ON_DEMAND(on_demand_calc)


      {


      Domain *d;


      Thread *t;


      d = Get_Domain(1);


       


      message("Hello Worldn");


      }

    • DrAmine
      Ansys Employee

      Okay what you are sharing is definelty wrong. Check this


       



      How to access the ANSYS Online Help


       


       

    • Jeroen
      Subscriber

      Your code gives me the exact same error:


       


      ****************************************************************************


      ****************************************************************************


      ** WARNING: Automatically switched to run in parallel -t1 mode. **


      ** Detected non-parallelized UDF usage, enabling parallel usage. **


      ** If you encounter any issues, please re-run with -t0 flag. **


      ****************************************************************************


      ****************************************************************************udf_names.c and user_nt.udf files in 3d_node are upto date.


      (system "copy "C:PROGRA~1ANSYSI~1v195fluent"fluent19.5.0srcudfmakefile_nt.udf "libudfwin643d_nodemakefile" ")


      1 file(s) copied.


      (chdir "libudf")(chdir "win643d_node")# Generating ud_io1.h


      Hello.c


      # Generating udf_names.c because of makefile Hellbj


      udf_names.c


      udf_names.c(7): error C2059: syntax error: '}'


      udf_names.c(8): warning C4034: sizeof returns 0


       


       


      Done.

    • DrAmine
      Ansys Employee

      The error is related to the udf_names which does tell me that there was no DEFINE macro defined in the UDF. If you open udf_names.c you will on line 6 to 7 that the array is empty. Something is still wrong with the UDF you are using (even the one which is posted perhaps you have white spaces,...) I do not know.

Viewing 9 reply threads
  • You must be logged in to reply to this topic.