CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Access variables from previous iteration (http://www.cfd-online.com/Forums/fluent-udf/114772-access-variables-previous-iteration.html)

elys March 17, 2013 13:09

Access variables from previous iteration
 
Hello everybody,

I have read through various postings and did some "googling", however I couldn't find a satisfying solution for my problem.
Lets say I have defined some local variables in my UDF computing some coefficients and the UDF is working well so far. Now, I want to extend the UDF having some additional functionality. In order to do so, it is necessary to access these coefficients from a previous iteration. What do I have to do to get access to these kind of data? The only thing I can think about is to allocate user defined memory, but this would also mean, that the memory is allocated for every cell, right? Is there another way for accessing or storing data which is not bounded to a cell, face or node?

Thanks so much in advance!

Ben

vasava March 18, 2013 02:35

I think the thread (http://www.cfd-online.com/Forums/flu...-used-udf.html ) has the answer to your problem.

elys March 19, 2013 16:15

Thanks for the hint, but I think this is not the solution for my problem. If I understood correctly a UDM allocates a datatype for each cell, which is not what I want and would waste a lot of memory.

However, I think the solution is to declare either variables as static to get access to the content in the next iteration or use the rpc_setvar procedure from the scheme environment. Of course the UDM approach will work as well (I do use it right now, because I couldnt try the other ways yet), but for the 10 values or so I need from the previous iteration the UDM method is far to overheaded.

Thanks again and maybe somebody has another idea or points me into the right direction ;)

Cheers,

Ben


All times are GMT -4. The time now is 08:24.