
[Sponsors] 
May 20, 2013, 00:50 
Adjusting UDM to UDS

#1 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
Hi
I have define adjusted UDM to UDS and for this UDS I am not solving any transport equation, hence default BC i.e flux zero and solution UDS equation in off mode. Now in the contours of UDM and UDS, there is mismatch at on the boundaries. Because I have used, C_UDMI() = C_UDSI(). This assigns the cell centroid values only. Now in order to assign face centroid values I followed below mentioned ways but it did not work. (1) define_profile condition on boundaries. (2) similar to cell centroid adjustment, face centroid adjustment If any one have tried on this issue. According to you which option should work. Thanks in advance for your reply Mvee 

May 21, 2013, 00:29 

#2 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
any response?


May 21, 2013, 22:48 

#3 
Senior Member
Join Date: Aug 2011
Posts: 315
Rep Power: 13 
Have you tried to loop all the face threads and cell threads?
The UDM is not associated with certain type of boundaries. 

May 22, 2013, 04:27 

#4 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
I opted the second the way i.e adjusted the face centroid values also. This is only possible by Lookup_Thread on defined face thread.


May 22, 2013, 05:18 

#5 
Senior Member
Join Date: Aug 2011
Posts: 315
Rep Power: 13 
I speculate that the difference appeared in the contour is due to different interpolation schemes for UDM and UDS. Is the mismatch most apparent at the edge of your b.c.? For twofaced b.c. like interface, the UDM is not defined but I think UDS would be defined there.


May 22, 2013, 07:51 

#6 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
I got the solution.
As I told you that for C_UDMI to C_UDSI , the cell centroid values are transfered; while it is considering the BC values on the face which is not the actual physics. Values of the algebraic expression that is stored in memory should transferred everywhere which in turn overwrite the BC. To achieve this in addition to cell centroid values, face centroid values are also incorporated through additional face loop. 

May 22, 2013, 08:37 

#7 
Senior Member
Join Date: Aug 2011
Posts: 315
Rep Power: 13 
So what is the difference between you final solution and your first post in this thread?


May 23, 2013, 02:02 

#8 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
Both the ways are correct. First option you can utilize on the face for which transport equation is required to be solved while second option can be utilized when there is no need of solution of scalar transport equation. Second option requires proper looping macros where I was doing mistake.


January 26, 2016, 13:06 

#9 
Senior Member
Przemek
Join Date: Jun 2011
Posts: 149
Rep Power: 8 
Hi mvee,
I assigned C_T to UDS however values are not equall at the boundary. So I did face looping as you suggested. But it still does not work. Can you tell me where I do mistake: Code:
# include "udf.h" # define domain_ID 1 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; Thread *tf; 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_T(c,t); } end_c_loop (c,t) } tf = Lookup_Thread(domain,11); thread_loop_f (tf,domain) { if (THREAD_STORAGE(tf,SV_UDS_I(0))!=NULL) begin_f_loop (f,tf) { F_UDSI(f,tf,0) = F_T(f,tf); } end_f_loop (f,tf) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; face_t f; Thread *t; Thread *tf; domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { //C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); C_UDMI(c,t,0) = C_UDSI(c,t,0); } end_c_loop (c,t) } tf = Lookup_Thread(domain,11); thread_loop_f (tf,domain) { if (THREAD_STORAGE(tf,SV_UDS_I(0))!=NULL) begin_f_loop (f,tf) { F_UDMI(f,tf,0) = F_UDSI(f,tf,0); } end_f_loop (f,tf) } }
__________________
best regards pblasiak 

January 26, 2016, 21:35 

#10 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
I do not see any mistake in UDF. You plot the face centered value of CT and CUDS and check its consistency. Keep in mind that node values will differ.


January 27, 2016, 03:32 

#11  
Senior Member
Przemek
Join Date: Jun 2011
Posts: 149
Rep Power: 8 
Quote:
I used this code (the previous one I posted where you did not find any mistake): Code:
# include "udf.h" # define domain_ID 1 DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; Thread *tf; 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_T(c,t); } end_c_loop (c,t) } tf = Lookup_Thread(domain,11); thread_loop_f (tf,domain) { if (THREAD_STORAGE(tf,SV_UDS_I(0))!=NULL) begin_f_loop (f,tf) { F_UDSI(f,tf,0) = F_T(f,tf); } end_f_loop (f,tf) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; face_t f; Thread *t; Thread *tf; domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain) { begin_c_loop (c,t) { //C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); C_UDMI(c,t,0) = C_UDSI(c,t,0); } end_c_loop (c,t) } tf = Lookup_Thread(domain,11); thread_loop_f (tf,domain) { if (THREAD_STORAGE(tf,SV_UDS_I(0))!=NULL) begin_f_loop (f,tf) { F_UDMI(f,tf,0) = F_UDSI(f,tf,0); } end_f_loop (f,tf) } } It is very strange because I only assigned the values and in the file one can see a lot of differences in resulting values??? Does anybody know how to do it correctly?
__________________
best regards pblasiak 

January 27, 2016, 05:14 

#12 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
thats true!
Values would differ. I donot know reason. You check %age error and if it allowable according to you physics you go ahead with it. You only compare cell values not node values because it follows different method to calculate node value of UDS/UDM and T. 

January 27, 2016, 06:51 

#13 
Senior Member
Przemek
Join Date: Jun 2011
Posts: 149
Rep Power: 8 
Yes but my really purpose is to calculate gradient on the wall so it can influence on the results. I cannot find any piece of code how to properly assign UDS to UDM. I found only how to assign C_T to UDS:
http://aerojet.engr.ucdavis.edu/flue...df/node235.htm
__________________
best regards pblasiak 

January 27, 2016, 06:55 

#14 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 10 
use first order scheme on wall to calculate grad T and assign it to FUDS/FUDM.


January 27, 2016, 07:39 

#15 
Senior Member
Przemek
Join Date: Jun 2011
Posts: 149
Rep Power: 8 
it does not work
I think that macro for UDM works strange or I coded it in a wrong way??
__________________
best regards pblasiak 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Segmentation violation  louiza  FLUENT  16  June 27, 2017 15:41 
UDS Unsteady with UDM  shashank312  FLUENT  3  May 15, 2013 15:35 
UDS stored to UDM do not show the same values  swati_mohanty  FLUENT  0  December 3, 2010 04:46 
UDS & UDM  fluent_usr  FLUENT  1  June 18, 2008 03:28 
usage of UDS & UDM  Tong  FLUENT  2  February 15, 2006 11:32 