Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Viscosity UDF Compile

    • le.martinezalvarado
      Subscriber

      Hi everyone! Im working on the simulation welding process on ansys fluent; Im kind a begginer on this tool and especially  I have some questions/problems with my UDF. I know that the next stape before writing UDF is compile, but since here im lost. Which program I need to compile UDF? How is the impletantion on the software fluent? I wrote on notepad...


       


      #include "mem.h"


      #include "math.h"


      #include "udf.h"


      DEFINE_PROPERTY(cell_viscosity,c,t) 


      {


      real mhu;


      real Q=176867;


      real R=8.314;


      real A=4.46 exp(13);


      real n=5.86;


      real alfa=0.0118;


      real SR=C_STRAIN_RATE_MAG(c,t);


      real temp=C_T(c,t);


      real Z;


      real S;


       


      Z=SR exp(Q/R*temp);


      S=(1/alfa)*asinh[pow((Z/A),(1/n)];


      mhu=S/(3*SR);


       


      return mhu;


      }


       


      This the code and if someone had a observation I'll very gratefull. Thanks for advanced.

    • Max4
      Subscriber

      Hi,


      For compiling an UDF,  a C-compiler must be installed, like Visual Studio.


      You can see this discussion for installing it and check the compatibility version between your ANSYS Version and Visual Studio 2017 : /forum/forums/topic/writing-udf-1/


      To compile an UDF in Fluent, follow these instructions:


      - In User Defined, click on Functions and Compiled



      - Then click on Add and choose the file (in c. format). Click on Build, and Then Load it.



       


      Regards,


      Maxime


       

    • Amine Ben Hadj Ali
      Ansys Employee

      Thanks Maxime! Weiter so!

    • le.martinezalvarado
      Subscriber

      Thanks a lot! Now I have the error "nmake' is not recognized as an internal or external command, operable program or batch file. 'nmake' is not recognized as an internal or external command, operable program or batch file" I started fluent from prompt command and I change the working directory to the deskopt. Its VS community 2017 and ansys 17.2. Could be a compatibility problem? Thanks for advanced.

    • Amine Ben Hadj Ali
      Ansys Employee
    • Max4
      Subscriber
      Make sure that Ansys and VS are installed on the same hard disk.

      Moreover, be sure that you have installed all the required packages:
      /forum/forums/topic/writing-udf-1/
Viewing 5 reply threads
  • The topic ‘Viscosity UDF Compile’ is closed to new replies.