DEFINE_EXECUTE_AT_END --> loop on boundary with the use of Lookup_Thread ???
Hi,
Here is a simple UDF that calculates and prints the volume integral of temperature at the end of each time step: Code:
#include "udf.h" Any idea how I can tell DEFINE_EXECUTE_AT_END to loop on a boundary? |
As you mentioned, use "Look_Thread" to find the specific thread.
Code:
#include "udf.h" DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *d; Thread *t; real sum_T=0.; cell_t c; |
Thanks blackmask, I got it. Your example had little errors: it loops over cells instead of faces, and you inverted d and 12 in Lookup_Thread(d, 12). I guess you wrote it quick.
Here is my code for calculating area averaged T on outlet at the end of each time step: Code:
DEFINE_EXECUTE_AT_END(execute_at_end) |
You are right, I misplaced the domain pointer and thread id. However "begin_c_loop" and "begin_f_loop" are equivalent macros. I clicked "reply", copied your original code, added several lines and manually adjust the indentation. For some reason the format of the code is mangled.
|
All times are GMT -4. The time now is 08:32. |