some problem in the UDS
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)*(Dphi), 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_DENC_UDSI(c,t,0)); return source ; } ================================================== ===== my problem is when I simulate the UDS with CE, ME and EE, 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 ! 
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 .... 
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, 
Thank you, Amir. I will keep checking my code.

All times are GMT 4. The time now is 05:11. 