|
[Sponsors] |
May 20, 2013, 01:50 |
Adjusting UDM to UDS
|
#1 |
Senior Member
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17 |
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, 01:29 |
|
#2 |
Senior Member
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17 |
any response?
|
|
May 22, 2013, 05:27 |
|
#4 |
Senior Member
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17 |
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, 06:18 |
|
#5 |
Senior Member
|
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 two-faced b.c. like interface, the UDM is not defined but I think UDS would be defined there.
|
|
May 22, 2013, 08:51 |
|
#6 |
Senior Member
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17 |
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 23, 2013, 03:02 |
|
#8 |
Senior Member
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17 |
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: 249
Rep Power: 16 |
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: 172
Rep Power: 17 |
I do not see any mistake in UDF. You plot the face centered value of C-T and C-UDS 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: 249
Rep Power: 16 |
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: 172
Rep Power: 17 |
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: 249
Rep Power: 16 |
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: 172
Rep Power: 17 |
use first order scheme on wall to calculate grad T and assign it to F-UDS/F-UDM.
|
|
January 27, 2016, 07:39 |
|
#15 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
it does not work
I think that macro for UDM works strange or I coded it in a wrong way??
__________________
best regards pblasiak |
|
June 26, 2018, 05:03 |
copy UDS to UDM
|
#16 |
New Member
sadik
Join Date: Feb 2018
Posts: 7
Rep Power: 8 |
Hello, I have a problem to copy uds to udm using the following code.
Code:
#include "udf.h" #include"sg.h" DEFINE_ON_DEMAND(copy_uds_to_udm) { Domain*d=Get_Domain(1); Thread*t; cell_t c; thread_loop_c(t,d) { begin_c_loop(c,t) { C_UDMI(c,t,0)=C_UDSI(c,t,0); } end_c_loop(c,t) } return; } please anyone help me with this. Thanks Umar Sadik |
|
June 26, 2018, 05:30 |
|
#17 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
delete
Code:
return; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation violation | louiza | FLUENT | 16 | June 27, 2017 16:41 |
UDS Unsteady with UDM | shashank312 | FLUENT | 3 | May 15, 2013 16: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 04:28 |
usage of UDS & UDM | Tong | FLUENT | 2 | February 15, 2006 11:32 |