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

User defined viscosity - error in load

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Far

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 15, 2015, 13:20
Cool User defined viscosity - error in load
  #1
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Here is my udf for defining the viscosity as function of temperature and pressure:

Code:
#include "udf.h"

DEFINE_PROPERTY(viscosity,c,t)
{
real mu_laminar, temp, pr; 

temp = C_T(c,t);

pr = C_T(c,t); 

mu_laminar = 0.0127*exp(0.000000213345*(pr-
101345))*exp(0.029*(temp-293));

return mu_laminar;

}
After compilation i get following message, which i am sure is OK!


D:\a\libudf\win64\3ddp\libudf.dll
Copied D:\a/D:\a\viscosity .c to libudf\src
udf_names.c and user_nt.udf files in 3ddp are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v160\fluent"\fluent16.0.0\sr c\udf\makefile_nt.udf "libudf\win64\3ddp\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp")
Done.


Then I click on load option to make it available to solver, but then I get this error message :



Any suggestion?
Attached Images
File Type: png Untitled.png (36.5 KB, 151 views)
Far is offline   Reply With Quote

Old   August 16, 2015, 01:26
Default
  #2
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Today morning, just started the procedure again without any changes to system configuration or Fluent settings and surprisingly every thing is working fine.


Though you can see that I have made few changes to UDF but that is not more than adding comments etc...

Here is the message I received now (perfectly working udf )




And UDF (also attached)



PS: I am using Visual studio Express 12.0. For editing of udf files ( c files in fact), I am using notepad++.
Attached Images
File Type: png 2.png (12.8 KB, 158 views)
File Type: jpg Untitled.jpg (38.9 KB, 152 views)
Attached Files
File Type: c viscosity.c (859 Bytes, 47 views)
soheil_r7 likes this.
Far is offline   Reply With Quote

Old   August 18, 2015, 06:38
Default
  #3
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
I generally find it safest to first unload the compiled library before building and loading a new library (instructions). Restarting Fluent would have a similar effect which could explain why the compilation worked next day.
`e` is offline   Reply With Quote

Old   August 18, 2015, 19:39
Default
  #4
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Just wondering, what is the purpose of return command?
Far is offline   Reply With Quote

Old   August 18, 2015, 20:00
Default
  #5
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Fluent UDF macros are implemented with the usual C function definitions which may return a value. Article on C Functions. In this particular case, the DEFINE_PROPERTY macro is called for each cell and returns the viscosity value. This process occurs when the properties are updated (near the end of each iteration before the convergence check).
`e` is offline   Reply With Quote

Reply

Tags
ansys, fluent, udf, user defined viscosity, viscosity


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
User Defined Scalars - Returning Values Carlos V. FLUENT 0 April 19, 2006 18:18
Source term for user defined scalars Mech.eng. Siemens 0 March 16, 2006 06:15
Usage of user defined functions Gowrish FLUENT 1 October 26, 2005 07:44
User viscosity routine and user scalars? Jeff Siemens 3 January 6, 2003 05:26
Commercial software question (user viscosity) Jeff Main CFD Forum 2 July 20, 2002 10:41


All times are GMT -4. The time now is 07:42.