CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

Accessing solution data in UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   June 11, 2002, 09:18
Default Accessing solution data in UDF
Posts: n/a
In paragraph 5.1 of the UDF Manual you can read this sentence about accessing solution data in user defined function:

" For all types of data except specifc heat, the word "access" refers to reading and writing data. "

I attempted to modify the species mass fraction C_YI(c,t,i) in the DEFINE_ADJUST macro, but I received an error message (ACCESS VIOLATION).

Is it really possible to modify such variable (and so I must look for a mistake in my code)? Have I misunderstood the Fluent Guide?

Thank you very much

  Reply With Quote

Old   June 12, 2002, 00:25
Default Re: Accessing solution data in UDF
Greg Perkins
Posts: n/a
It doesn't normally make sense to modify C_YI(or any solved for variable) in your udfs. The reason for this is that Fluent solves for C_YI as part of the solution method.

If you want to force the solution of C_YI to be a specific value in a specific cell then you can write a udf source function to accomplish this. This will then ensure the "solution" provided by Fluent is consistent with your inputs. Otherwise Fluent will just overwrite any changes you make in C_YI.

To fix Y for species-0 to say 0.5 write a source term like

DEFINE_SOURCE(My_YI_0,cell,thread,dS,eqn) {

dS[eqn] = -1.0e8;

return 1.0e8*(0.5 - C_YI(cell,thread,0); }

Also I recommend using the Fluent 6 udf manual in preference to the Fluent 5 one. The new one is much more detailed and up-to-date than the old one. And in fact, there are very few changes in the udfs in Fluent 6, so you can safely use the documentation of Fluent 6 in writing udfs for Fluent 5 (of course you can't use specific models etc which aren't in 5).

You may want to use Fluent 6 as well, but some people have reported some strange behaviours over 5 so its wise to check it out before moving across.


  Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
accessing solver data with UDF macros Dushan FLUENT 1 April 22, 2017 21:05
UDF save data to a file!! spk Fluent UDF and Scheme Programming 34 July 17, 2013 14:03
[Help Please], Trouble Using UDF to Import Velocity Data -- But All Zeros :( rockymountai FLUENT 1 November 11, 2009 16:30
How to read data into my UDF??? Harshit Gupta FLUENT 3 June 15, 2006 02:34
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07

All times are GMT -4. The time now is 01:52.