CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

some problem in the UDS

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 11, 2011, 04:55
Default some problem in the UDS
  #1
New Member
 
Yu-Pei Chen
Join Date: Jun 2011
Posts: 26
Rep Power: 6
ypchen is on a distinguished road
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 !
ypchen is offline   Reply With Quote

Old   October 11, 2011, 05:27
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Amir is on a distinguished road
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 \rho * C; 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
Amir is offline   Reply With Quote

Old   October 11, 2011, 09:24
Default
  #3
New Member
 
Yu-Pei Chen
Join Date: Jun 2011
Posts: 26
Rep Power: 6
ypchen is on a distinguished road
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 \rho * C; 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 ....
ypchen is offline   Reply With Quote

Old   October 11, 2011, 15:51
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Amir is on a distinguished road
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
Amir is offline   Reply With Quote

Old   October 11, 2011, 22:00
Default
  #5
New Member
 
Yu-Pei Chen
Join Date: Jun 2011
Posts: 26
Rep Power: 6
ypchen is on a distinguished road
Thank you, Amir. I will keep checking my code.
ypchen is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDS problem with wall boundary condition Alex F. FLUENT 14 August 6, 2014 05:08
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


All times are GMT -4. The time now is 16:01.