Viscosity UDF Compile

  • 62 Views
  • Last Post 08 March 2019
  • Topic Is Solved
Luis Enrique posted this 08 March 2019

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.

Order By: Standard | Newest | Votes
Max4 posted this 08 March 2019

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 : https://studentcommunity.ansys.com/thread/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

 

  • Liked by
  • Luis Enrique
abenhadj posted this 08 March 2019

Thanks Maxime! Weiter so!

Best regards,

Amine

  • Liked by
  • Max4
Luis Enrique posted this 08 March 2019

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.

abenhadj posted this 08 March 2019

Might be: https://studentcommunity.ansys.com/thread/compiler-requirements-for-windows-systems/

 

Best regards,

Amine

  • Liked by
  • Luis Enrique
Max4 posted this 08 March 2019

Make sure that Ansys and VS are installed on the same hard disk.

Moreover, be sure that you have installed all the required packages: https://studentcommunity.ansys.com/thread/writing-udf-1/

  • Liked by
  • Luis Enrique
Close