CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   access violation on periodic conditions (https://www.cfd-online.com/Forums/fluent/44958-access-violation-periodic-conditions.html)

John Deas June 7, 2007 12:35

access violation on periodic conditions
 
Hi,

I would like to write flow fields values (for an unsteady case) using an "execute at end" user defined function so I can have a sequence and look at the evolution. I really would like to implement this with an UDF.

If the boundary over which I loop to get the C_U values is a velocity inlet, it works and I get the value I put in the boundary condition panel. But, if I want to loop over a periodic boundary condition, with the same code, I get an ACCESS VIOLATION

Here is the small code I wrote to test the loop. thread_id=5 correspond to the boundary condition.

#include "udf.h"

DEFINE_EXECUTE_AT_END(execute_at_end) { Thread *th = NULL; Domain *domain = Get_Domain(1); int thread_id = 5; cell_t c; float speed = 0;

th = Lookup_Thread(domain,thread_id) ; begin_c_loop(c,th)

{ speed = C_U(c,th); printf("%f\n",speed); } end_c_loop(c,th)

}

However, I can get other value in the periodic case (for example, the centroid position): only retrieving the speed components is not working.

Thanks,

John



All times are GMT -4. The time now is 10:29.