CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

why UDS assigning does not work?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2016, 05:59
Default why UDS assigning does not work?
  #1
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
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
gaza is offline   Reply With Quote

Old   January 26, 2016, 06:02
Default
  #2
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
# 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
gaza is offline   Reply With Quote

Old   January 26, 2016, 06:11
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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]
around your 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)
     }
 }
pakk is offline   Reply With Quote

Old   January 26, 2016, 07:45
Default
  #4
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
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
gaza is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 20:17.