CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF Loading Error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2021, 13:26
Default UDF Loading Error
  #1
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 6
Venky_94 is on a distinguished road
Hey,

I'm writing a UDF to store viscosity in a UDM and access it for other UDFs.

I'm getting the below error when I'm trying to load the UDF I've written for accessing the stored UDM. I've included the message for build and load. It shows no error while building, but I'm pretty sure the issue is with the code and not the compiler as other sample UDFs are compiling well.

Quote:
Copied C:\Sim\Flowinapipe_files\dp0\FFF-4\Fluent/C:\Sim\Flowinapipe_files\dp0\FFF-4\Fluent\Viscosity Checkup.c to libudf\src
user_nt.udf file is outdated. So, recreating the file for 2ddp_host ...
(chdir "libudf\win64\2ddp_host")(system "copy "C:\PROGRA~1\ANSYSI~1\v202\fluent"\fluent20.2.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp_host\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp_host")user_nt.udf file is outdated. So, recreating the file for 2ddp_node ...
(chdir "libudf\win64\2ddp_node")(system "copy "C:\PROGRA~1\ANSYSI~1\v202\fluent"\fluent20.2.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp_node")
Done.

550-0404: Opening library "C:\Sim\Flowinapipe_files\dp0\FFF-4\Fluent\libudf"...
Error at host: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

The system cannot find the file specified.

C:\Sim\Flowinapipe_files\dp0\FFF-4\Fluent\libudf\win64\2ddp_host\libudf.dll

Error at Node 0: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

The system cannot find the file specified.

C:\Sim\Flowinapipe_files\dp0\FFF-4\Fluent\libudf\win64\2ddp_node\libudf.dll

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\nC:\Sim\Flowinapipe_files\dp0\FFF-4\Fluent\libudf\win64\2ddp_host\libudf.dll
Error Object: #f
This is the UDF.

Code:
/********************************************************************
UDF for defining the non-Newtonian fluid viscosity using APL model
*********************************************************************/

#include "udf.h"
DEFINE_PROPERTY(nnviscosity,c,t)
{
real mu = C_UDMI(c,t,0);
return mu;
}
Below is the code I've used for calculating and storing the viscosity and it is building and loading without any errors.

Code:
/******************************************************************************
UDM for storing the non-Newtonian fluid viscosity calculated using APL model
*******************************************************************************/

#include "udf.h"
#define domain_ID 1		/*Defines the primary phase which is the non-Newtonian fluid */

DEFINE_ADJUST(non_newtonian_viscosity_udm, domain)
{
Thread *t;
cell_t c;
domain = Get_Domain(domain_ID);

/* Declare the coefficients for APL model to calculate non-Newtonian viscosity */
real mu_0 = 15.9350;
real k = 19.5531;
real n = 0.2891;
real p = -1.00;
real shear_rate;

/* Calculate the viscosity and store in UDM */

thread_loop_c(t, domain) /* loops over all cell threads in domain */
{
begin_c_loop(c, t)	/* loops over cells in a cell thread */
{
shear_rate = C_STRAIN_RATE_MAG(c,t);
C_UDMI(c,t,0) = pow((pow(mu_0,p) + pow((k*pow(shear_rate, (n-1))),p)),pow(p,-1));
}
end_c_loop(c, t)
}

}
Please help in debugging the UDF. Thanks
Venky_94 is offline   Reply With Quote

Old   March 22, 2021, 13:55
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
You have a space in your filename, try without that.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   March 22, 2021, 15:09
Default
  #3
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 6
Venky_94 is on a distinguished road
Quote:
Originally Posted by pakk View Post
You have a space in your filename, try without that.
I can't believe it was that silly mistake. My bad. Thanks a lot. I was able to sort that out.
Venky_94 is offline   Reply With Quote

Old   March 22, 2021, 15:52
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I can't believe Ansys still did not fix this. It has been a problem for so long, and the solution does not seem so difficult...
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Reply

Tags
compilation error, udf, udm


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 08:11
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:31
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23


All times are GMT -4. The time now is 18:16.