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

Accessing solution data in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 11, 2002, 10:18
Default Accessing solution data in UDF
  #1
Ale
Guest
 
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

Ale
  Reply With Quote

Old   June 12, 2002, 01:25
Default Re: Accessing solution data in UDF
  #2
Greg Perkins
Guest
 
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.

Greg

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


All times are GMT -4. The time now is 20:36.