mostanad |
January 6, 2017 05:04 |
my udf problem!!!
Hello everybody
I want to compile my udf in fluent. the udf is is a simple parabolic velocity profile in pipe and inlet. as shown below:
Code:
/***********************************************************************
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.186; /* 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) = 1*(1.0-y*y);
}
end_f_loop(f, thread)
}
at first I am using windows 7, ansys fluent 16.2, Microsoft visual studio 2008. also I have Microsoft windows SDK 7.1. when I want to compile my udf, I use two methods. first: running fluent with Microsoft visual studio command prompt and second:running fluent with Microsoft windows sdk 7.1. also my case, .c and .h files are in same folders. with first method, it seems very good in "build" item. but the problem is with loading that gives me error as shown below:
build:
Code:
Copied E:\project urbulence\p-2\PROJ_files\dp0\FLU\Fluent/E:\project urbulence\p-2\PROJ_files\dp0\FLU\Fluent\inlet_x_velocity.c to libudf\src
user_nt.udf file is outdated. So, recreating the file for 2d ...
(chdir "libudf\win64\2d")(system "copy "C:\PROGRA~1\ANSYSI~1\v162\fluent"\fluent16.2.0\src\udf\makefile_nt.udf "libudf\win64\2d\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2d")# Generating ud_io1.h
inlet_x_velocity.c
# Generating udf_names.c because of makefile inlet_x_velocity.obj
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj inlet_x_velocity.obj
Microsoft (R) Incremental Linker Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
Creating library libudf.lib and object libudf.exp
Done.
and load:
Code:
Opening library "E:\project\turbulence\p-2\PROJ_files\dp0\FLU\Fluent\libudf"...
Error: Error code: 193
Error: Error code: 193
Error Object: #f
but when opening case file with microsoft windows sdk it gives:
in build:
Code:
Copied E:\project urbulence\p-2\PROJ_files\dp0\FLU\Fluent/E:\project urbulence\p-2\PROJ_files\dp0\FLU\Fluent\inlet_x_velocity.c to libudf\src
Creating user_nt.udf file for 2d ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v162\fluent"\fluent16.2.0\src\udf\makefile_nt.udf "libudf\win64\2d\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2d")# Generating ud_io1.h
inlet_x_velocity.c
C:\PROGRA~1\ANSYSI~1\v162\fluent\fluent16.2.0\src\main\global.h(9) : fatal error C1083: Cannot open include file: 'stdio.h': Invalid argument
Done.
but in load:
Code:
Opening library "E:\project\turbulence\p-2\PROJ_files\dp0\FLU\Fluent\libudf"...
Error: The UDF library you are trying to load (libudf) is not compiled for 2d on the current platform (win64).
The system cannot find the file specified.
E:\project\turbulence\p-2\PROJ_files\dp0\FLU\Fluent\libudf\win64\2d\libudf.dll
Error: The UDF library you are trying to load (libudf) is not compiled for 2d on the current platform (win64).
The system cannot find the file specified.
E:\project urbulence\p-2\PROJ_files\dp0\FLU\Fluent\libudf\win64\2d\libudf.dll
Error Object: #f
i am very confused. is anybody solve these problems???
thanks guys
|