CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF Error: Error code 126 (https://www.cfd-online.com/Forums/fluent/250628-udf-error-error-code-126-a.html)

cilliant June 30, 2023 06:52

UDF Error: Error code 126
 
Hi Everyone,

I have been struggling with loading a custom UDF now for a couple of days. I am using ANSYS 2021R1 and visual studio 2017.

I have followed the relevant steps and added to following enviroment variables (these are as close to the instructions for VS10 as given in the FAQ as I could get)

I launch fluent from x64 Native tools prompt, in my working director with case files. When I build my UDF I get:

Code:

Copied C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent/C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\exampleudf.c to libudf\src
(system "copy "c:\PROGRA~1\ANSYSI~1\v211\fluent"\fluent21.1.0\src\udf\sconstruct.udf "libudf\win64\3ddp_host\SConstruct" ")
        1 file(s) copied.
(system "copy "c:\PROGRA~1\ANSYSI~1\v211\fluent"\fluent21.1.0\src\udf\scons_default.bat "libudf\win64\3ddp_host\scons_test.bat" ")
        1 file(s) copied.
Files udf_names.c and user_nt.udf in 3ddp_host are up-to-date.
(system "copy "c:\PROGRA~1\ANSYSI~1\v211\fluent"\fluent21.1.0\src\udf\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ")
        1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_host")
C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\libudf\win64\3ddp_host>rem 

C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\libudf\win64\3ddp_host>rem  Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.

C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\libudf\win64\3ddp_host>rem 
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25027 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

Microsoft (R) Program Maintenance Utility Version 14.10.25027.0
Copyright (C) Microsoft Corporation.  All rights reserved.

(system "copy "c:\PROGRA~1\ANSYSI~1\v211\fluent"\fluent21.1.0\src\udf\sconstruct.udf "libudf\win64\3ddp_node\SConstruct" ")
        1 file(s) copied.
(system "copy "c:\PROGRA~1\ANSYSI~1\v211\fluent"\fluent21.1.0\src\udf\scons_default.bat "libudf\win64\3ddp_node\scons_test.bat" ")
        1 file(s) copied.
Files udf_names.c and user_nt.udf in 3ddp_node are up-to-date.
(system "copy "c:\PROGRA~1\ANSYSI~1\v211\fluent"\fluent21.1.0\src\udf\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ")
        1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_node")
C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\libudf\win64\3ddp_node>rem 

C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\libudf\win64\3ddp_node>rem  Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.

C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\libudf\win64\3ddp_node>rem 
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25027 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

Microsoft (R) Program Maintenance Utility Version 14.10.25027.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Done.

When I load I get:
Code:

mme144143: Opening library "C:\RANS c drive\rans_c_drive_files\dp0\FLU-12\Fluent\libudf"...
Error at Node 1: Error code: 126


Error at Node 4: Error code: 126


Error at Node 2: Error code: 126


Error at Node 3: Error code: 126


Error at Node 6: Error code: 126


Error at Node 5: Error code: 126


Error at Node 7: Error code: 126


Error at Node 8: Error code: 126


Error at Node 9: Error code: 126


Error at Node 10: Error code: 126


Error at Node 12: Error code: 126


Error at Node 11: Error code: 126


Error at Node 13: Error code: 126


Error at Node 14: Error code: 126


Error at Node 15: Error code: 126


Error at Node 0: Error code: 126


Error at Node 16: Error code: 126


Error at Node 19: Error code: 126


Error at Node 17: Error code: 126


Error at Node 18: Error code: 126


Error at host: Error code: 126


Error: Error code: 126\n
Error Object: #f

I am running 20 parallel cores hence why it shows 20 times. I have had a few errors fixed before, such as trouble accessing libudf.dll and nmake errors, but now I am stuck on this one.

My UDF files is

Code:

exampleudf.c
/***********************************************************************
 udfexample.c
 UDF for specifying steady-state velocity profile boundary condition
 ************************************************************************/
 #include "udf.h"
 DEFINE_PROFILE(inlet_x_velocity, thread, position)
 {
 real x[ND_ND]; /* this will hold the position vector */
 real y, h;
 face_t f;
 h = 0.016; /* inlet height in m */
 begin_f_loop(f,thread)
 {
 F_CENTROID(x, f, thread);
 y = 2.*(x[1]-0.5*h)/h; /* non-dimensional y coordinate */
 F_PROFILE(f, thread, position) = 0.1*(1.0-y*y);
 }
 end_f_loop(f, thread)
 }

I actually wanted to load one for turbulent flame speed, but I cannot even get the example one to work !

I appreciate any help,
Cillian


All times are GMT -4. The time now is 03:25.