|
[Sponsors] |
June 11, 2002, 10:18 |
Accessing solution data in UDF
|
#1 |
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 |
|
June 12, 2002, 01:25 |
Re: Accessing solution data in UDF
|
#2 |
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 |
|
|
|
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 |