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

my udf problem!!!

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mostanad

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2017, 06:04
Default my udf problem!!!
  #1
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 281
Rep Power: 12
mostanad is on a distinguished road
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

mostanad is offline   Reply With Quote

Old   January 6, 2017, 14:44
Default
  #2
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 281
Rep Power: 12
mostanad is on a distinguished road
and no answer yet???!!!
mostanad is offline   Reply With Quote

Old   January 10, 2017, 13:20
Default
  #3
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 10
Boh is on a distinguished road
maybe your microsoft visual studio version is too old...try to download the 2013...(have you add the enviromental variables?)
Boh is offline   Reply With Quote

Old   January 10, 2017, 13:23
Default Solved
  #4
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 281
Rep Power: 12
mostanad is on a distinguished road
Thanks a lot
Finally o have solved my problem. I am using microsoft windows sdk 7 so i link it to my visual studio 2008 in its configuration tools.
THA SEANGHAI likes this.
mostanad is offline   Reply With Quote

Reply


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
Problem with DPM simulation with particles injection and EXECUTE_AT_THE_END UDF. Ari Fluent UDF and Scheme Programming 4 May 31, 2016 09:51
udf loading problem santu Fluent UDF and Scheme Programming 1 May 22, 2015 16:47
Vaporization pressure UDF property problem? lehoanganh07 Fluent UDF and Scheme Programming 1 September 13, 2014 11:59
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 07:56


All times are GMT -4. The time now is 21:37.