|
[Sponsors] |
October 11, 2011, 04:55 |
some problem in the UDS
|
#1 |
New Member
Yu-Pei Chen
Join Date: Jun 2011
Posts: 26
Rep Power: 14 |
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
|
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: 14 |
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
|
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: 14 |
Thank you, Amir. I will keep checking my code.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDS problem with wall boundary condition | Alex F. | FLUENT | 15 | September 21, 2015 09:28 |
Velocity profiles problem behind the elbow (3D problem) | kabat73 | FLUENT | 8 | May 9, 2010 04:26 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 06:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 19:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 14:52 |