# some problem in the UDS

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 11, 2011, 04:55 some problem in the UDS #1 New Member   Yu-Pei Chen Join Date: Jun 2011 Posts: 26 Rep Power: 6 hi, everybody, I create a UDS as follow : d(phi)/dt=m, where phi is scalar variable, and m is my source term : m = C*exp(-E/RT)*log(p/p_eq)*(D-phi), where C, E, R and D are constant, T is temperature, p is pressure and p_eq is equilibrium pressure (function of temperature). I wrote a udf code below : ================================================== ======= #include "udf.h" #include "mem.h" #include "math.h" #include "stdio.h" #define R 8.314 #define E 21180 #define C 59.19 #define SAT_DEN 7259 #define A 17.61 #define B 3704.6 DEFINE_ADJUST(absorption,d) { Thread *t; cell_t c ; real p_g ; real P_eq; real m ; thread_loop_c(t,d) { begin_c_loop(c,t) { real tem = C_T(c,t) ; p = C_P(c,t)+101325; p_eq= 1000*exp(A-(B/tem)); m = C*exp(-E/R*tem)*log(p/p_eq); C_UDMI(c,t,0) = m ; } end_c_loop(c,t) } } DEFINE_SOURCE(uds_source,c,t,dS,eqn) { real source ; source = C_UDMI(c,t,0)*(SAT_DEN-C_UDSI(c,t,0)); return source ; } ================================================== ===== my problem is when I simulate the UDS with C-E, M-E and E-E, the result is not good, because the phi's distribution is very uniform, but I expect its distribttion are respect to the location, it should not be uniform, can anybody help me ? thank you !

 October 11, 2011, 05:27 #2 Senior Member     Amir Join Date: May 2009 Location: Shiraz, Iran Posts: 739 Blog Entries: 1 Rep Power: 14 Hi, 1- your source term is a function of UDS, so you can define it's derivation with respect to your UDS to enhance stability. 2- Did you disable convective term of UDS equation while activation? 3- Did you set diffusion coefficient to zero? 4- According to UDS equation, the phi variable would be ; which C is your UDS; if your base fluid density is not equal to 1, you have to change your source equation respectively. (BC should be changed) Bests, __________________ Amir

 October 11, 2011, 09:24 #3 New Member   Yu-Pei Chen Join Date: Jun 2011 Posts: 26 Rep Power: 6 hi, thank for your reply, Amir 1- your source term is a function of UDS, so you can define it's derivation with respect to your UDS to enhance stability. -------------Ok , I'll try . 2- Did you disable convective term of UDS equation while activation? -------------yes, I set it to be "none" in the panel. 3- Did you set diffusion coefficient to zero? -------------yes, in the Material setting. 4- According to UDS equation, the phi variable would be ; which C is your UDS; if your base fluid density is not equal to 1, you have to change your source equation respectively. (BC should be changed) ------------I use the macro "DEFINE_UDS_UNSTEADY" to set the unsteady term, and let the rho equal to 1. my simulation can run when the udf code is used, but the result seems not good ....

 October 11, 2011, 15:51 #4 Senior Member     Amir Join Date: May 2009 Location: Shiraz, Iran Posts: 739 Blog Entries: 1 Rep Power: 14 Ok, it doesn't need any other special settings; it can be implied form results that your source term is large! Maybe its better to check dimension of constants .... Bests, __________________ Amir

 October 11, 2011, 22:00 #5 New Member   Yu-Pei Chen Join Date: Jun 2011 Posts: 26 Rep Power: 6 Thank you, Amir. I will keep checking my code.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Alex F. FLUENT 14 August 6, 2014 05:08 kabat73 FLUENT 8 May 9, 2010 04:26 Se-Hee CFX 2 June 10, 2007 06:29 ParodDav CFX 5 April 29, 2007 19:13 Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52

All times are GMT -4. The time now is 08:13.