Problems Loading UDF for Moving Mesh in fluent

  • 661 Views
  • Last Post 3 weeks ago
navid3952 posted this 04 October 2017

Hi

I'm using the following UDF. My Ansys version is 17.2. 

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

/**********************************************************

 node motion based on blade deflection equation

 compiled UDF

 **********************************************************/

#include "udf.h"

 

DEFINE_GRID_MOTION(beam,domain,dt,time,dtime)

{

  Thread *tf = DT_THREAD(dt);

  face_t f;

  Node *v;

  NV_VEC(axis);

  NV_VEC(dx);

  real NV_VEC(origin);

  NV_VEC(rvec);

  real sign;

  int n;

  real L0;

  real L;

  real A;

  real f;

  real a; 

  real sign;

  int n;

  

  /* set deforming flag on adjacent cell zone */

  SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

 

  L0 = 0.032; // original length of the blade (m)

  L = 0.7236*L0; // effective length (m)

  //x = 0:0.001:L0; // no need for this probably

  A = 0.01; // Amplitude of the oscillations (m)

  f = 20; // frequency (Hz)

  a = A/(1.1708*L0^3); 

  

  Message ("time = %f, amplitude= %f\n", time, A);

  

  NV_D(origin, =, -0.096, 0.0, 0.0); // this should be the coordinates of the blade root

 

  begin_f_loop(f,tf)

    {

      f_node_loop(f,tf,n)

        {

          v = F_NODE(f,tf,n);

 

          /* update node if the current node has not been previously

             visited when looping through previous faces */

          if (NODE_POS_NEED_UPDATE (v))

            {

              /* indicate that node position has been update

                 so that it's not updated more than once */

              NODE_POS_UPDATED(v);

 

              NV_VV(rvec, =, NODE_COORD(v), -, origin);

      rvec[2] = a*sin(2*3.1415926*f*time)*(3*L*rvec[1]^2-rvex[1]^3);

              NV_S(rvec, +=, origin)

              NV_V(NODE_COORD(v), =, rvec);

            }

        }

    }

 

  end_f_loop(f,tf);

}

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

When I want to load the file, I get this error: 

 

Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nThe system cannot find the file specified.

\n\nD:\Flapping Wing Simulations\moving mesh Piezofan simulation\Test1\MMPiezoFan_files\dp0\FFF\Fluent\libudf\win64\3ddp_host\libudf.dll

Error Object: #f

 

Any suggestions?

 

Thanks

Order By: Standard | Newest | Votes
Nabaraj posted this 27 October 2017

Hi navid,

Either you need to launch fluent in serial mode to load the existing compiled libudf library

Or,

you can unload the existing libudf library which is compiled for serial mode and recompile the udf in Fluent in parallel mode.

 

Cheers,

Raef.Kobeissi posted this 27 October 2017

Hello Navid Further to Nabaraj’s comment, I would also add that it is worth checking if you have a compiler installed on your machine such as Microsoft Visual Studio.

Regards

Raef Kobeissi

Naiara posted this 4 weeks ago

Hello, I also have a similar error and I check and I have Microsoft Visual Studio installed.

My error is the following one: "The UDF library you are trying to load (libudf) is not compiled for 3ddp on the current platform (win64). The system cannot find the file specified."

Thank you in advance!

 

 

 

 

Attached Files

raul.raghav posted this 4 weeks ago

Naiara, which version of Visual Studio do you have installed and which Ansys release are you working with?

Attached is a screenshot of the compiler compatibility provided in the Ansys Installation Manual.

Rahul

Naiara posted this 3 weeks ago

Hi Rahul,

I am using Fluent 15 and I have installed Microsoft visual studio 2012, so that could be the problem?

I need Microsoft Visual Studio 2010 for Fluent 15.0 or use, for example, Fluent 18.2, isn't it?

Thank you in advance,

Naiara

vganore posted this 3 weeks ago

How are you launching Fluent? Through workbench directly? Do you also having SDK installed? Try launching Fluent from it.

Vishal Ganore, ansys.com/student

  • Liked by
  • Naiara
raul.raghav posted this 3 weeks ago

Naiara, though Ansys recommends VS 2010 for Fluent 15.0, it did provide support for VS2012. Do you have any other Ansys release (17.0 or above) installed in your computer? Can you try them and update us?

Rahul

  • Liked by
  • Naiara
vganore posted this 3 weeks ago

It is a most common problem in lower versions 18.2 and below. Here is my feedback. 

  • Update ANSYS product to 19.0. Latest free student product 19.0 is available here: ansys.com/student
  • Download  & Install Microsoft Visual Studio Community 2017 from here: https://www.visualstudio.com/downloads/
  • While downloading, make sure you also select supported SDK & other components as highlighted below in red:

  • Launch Fluent in standalone mode or through Workbench (note the working directory). Make sure that you have case/data and UDF files placed under "Working Directory" used by Fluent.  
  • Compile your UDF file using User-defined Functions option (Build & Load).
  • Fluent should be able to compile your UDF. 

Let me know in case of any issues.

For lower versions as far as I understand, you need to launch Fluent from SDK command prompt or do some additional batch file setup. 

Vishal Ganore, ansys.com/student

  • Liked by
  • raul.raghav
  • Naiara
Naiara posted this 3 weeks ago

Thank you both, I will try it and I will let you know.

Naiara

Naiara posted this 3 weeks ago

Hello,

Now, I am working in Linux and I make an easy UDF to see if this works or not, and it does not work. I do not know it the UDF is written wrong or if it is a compiler compatibility problem or what.

I enclosure to the comment an screen shoot of the problem and the UDF file.

Thank you!

Naiara

Attached Files

vganore posted this 3 weeks ago

Can you explain in steps how are you launching Fluent? Which version of Fluent and VS are you using? 

Your UDF looks fine. It runs on my PC without any errors. 

Vishal Ganore, ansys.com/student

  • Liked by
  • Naiara
Naiara posted this 3 weeks ago

Hello, now it works.

Thank you.

vganore posted this 3 weeks ago

Great to know that it worked. Can you add some information about your issue and how it was fixed? It will be useful for students following this thread. 

Vishal Ganore, ansys.com/student

Close