|
[Sponsors] |
January 26, 2016, 05:59 |
why UDS assigning does not work?
|
#1 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi
I have such a piece of code: # include "udf.h" # define domain_ID 1 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { // assign temperature values into User scalar 0 C_UDSI(c,t,0) = C_T(c,t); } end_c_loop (c,t) } } I compiled and hooked this, allocated UDS (without flux) and did 50 iterations. I checked contours of Static temperature and User scalar 0 and they are not the same!!! Why it is so? I just assign temperature values into User scalar 0 and it does not work. Please help.
__________________
best regards pblasiak |
|
January 26, 2016, 06:02 |
|
#2 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
# include "udf.h" # define domain_ID 2 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_VOF(c,t); } end_c_loop (c,t) } }
__________________
best regards pblasiak |
|
January 26, 2016, 06:11 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
No answer, but I reformat your code because it is very difficult to read in this way. You can do this yourself by adding
HTML Code:
[CODE][/CODE] Your last code, in a readable format, is this: Code:
# include "udf.h" # define domain_ID 2 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); /* Fill UDS with the variable. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_VOF(c,t); } end_c_loop (c,t) } } |
|
January 26, 2016, 07:45 |
|
#4 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Ok thank you.
I took the code from here (at the end) http://jullio.pe.kr/fluent6.1/help/html/udf/node107.htm it is from documentation and it does not work. Why???
__________________
best regards pblasiak |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can you explain me how to use UDS? | Tleja | Fluent UDF and Scheme Programming | 0 | July 14, 2015 02:52 |
Set UDS on wall... | fivos | Fluent UDF and Scheme Programming | 2 | July 25, 2014 06:57 |
PEM modeling UDS diffusivity in mixture | gemini | FLUENT | 6 | August 7, 2012 08:37 |
A good question about UDS | Z | FLUENT | 1 | March 31, 2005 16:14 |
UDS | David | FLUENT | 1 | March 21, 2005 12:31 |