CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF:Accessing variables at different iteration lev (http://www.cfd-online.com/Forums/fluent/30161-udf-accessing-variables-different-iteration-lev.html)

varghese August 12, 2002 05:27

UDF:Accessing variables at different iteration lev
 
Dear All,

I wanted to write a UDF for iteration error analysis, which requires solution at different iteration levels. Can somebody tell me, how can one access the values of the same solution variable, at different iteration levels, in Fluent UDF.

Greetings,

Varghese

Anthony Wachs August 13, 2002 05:32

Re: UDF:Accessing variables at different iteration
 
Hi,

Fluent does not allow you to access to a same solution variable at different iteration levels since it is not stored owing to memory purposes.

But you can use the DEFINE_ADJUST function which is called by the fluent solver at every iteration. Thus, your DEFINE_ADJUST function would be dedicated to write the variable you are concerned with in a file, that would be numbered like file%i.res (%i is the iteration number) for instance.

At the end of your calculation, just fetch the different files and post-treat them using a mere in-house code you would have developed to perform the error analysis (in C or Fortran or whatever langage you are keen on).

Well, obviously, I never tested that solution but I think it might work. Moreover, if your calculation needs about some hundreds (or even thousands) iterations to converge, you are likely to obtain a rather great number of files, that would imply large memory storage. A solution could be to store the variables every x iteration, with x a convenient value greater than 1.

Hope it could help,

Best regards,

Anthony

varghese August 13, 2002 07:02

Re: UDF:Accessing variables at different iteration
 
Dear Anthony,

It looks like a possible solution to the problem. But I have to learn more about the functions of DEFINE_ADJUST in UDF.

Thank you very much for the suggestion,

Varghese


All times are GMT -4. The time now is 02:49.