|
[Sponsors] |
March 22, 2021, 13:26 |
UDF Loading Error
|
#1 | |
Member
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 6 |
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:
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; } 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) } } |
||
March 22, 2021, 13:55 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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". |
|
March 22, 2021, 15:09 |
|
#3 |
Member
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 6 |
||
March 22, 2021, 15:52 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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". |
|
Tags |
compilation error, udf, udm |
|
|
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 |