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

Two-phase Eulerian UDF problem

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2013, 16:31
Default Two-phase Eulerian UDF problem
  #1
New Member
 
Jin Zhang
Join Date: May 2013
Posts: 1
Rep Power: 0
zayafish is on a distinguished road
Hi,

I am developing an Eulerian two-phase axisymmetric model to predict the dynamic flow system in magnetic separation process. So I wrote a UDF for the source term for the force on magnetic particles (phase 2) due to the magnetic field. In my code, I defined several UDSs, which were just used as variables to store the FIXED values regarding the magnetic field strength or gradient. So these UDSs should be independent of time. However, after the simulation started running, the UDSs were perfectly showing the expected values for the first several seconds, and then it started to deform with time. As shown in the following figure, near the top two corners, the UDS 0 (magnetic field strength) values became zero. The two bubbles started from a small region (probably from one cell) and then grew bigger with time. If the simulation kept running, it just ruined all the values.

Since I am using UDSs to store the fixed values, the unsteady/convection/diffusion/sources in the main function of UDS should not be calculated. So in the User-Defined Scalars dialog box, I did switch the Flux Function and Unsteady Function to NONE. But this did not fix the deformation problem with time.

Here I attached my code. Can anyone help me figure out where I did wrong? How to resolve this deformation problem?

DEFINE_ADJUST(adjust_def,d)
{
Thread *t;
cell_t c;
real PI = 3.1415926;
real L = 0.04; /*Length of the tube*/
real MUO = 4*PI*pow(10,-7.);
real M = 1.220703;
real x;
real y;
real r1;
real r2;
real xc[ND_ND];
real origin[ND_ND];
origin[0]=0.0;
origin[1]=0.0;

thread_loop_c(t,d)
{
begin_c_loop_all(c,t)
{
C_CENTROID(xc,c,t);
xc[0]-=origin[0];
xc[1]-=origin[1];
x = xc[0];
y = xc[1];
r1 = pow(x+0.00625,2)+pow(y,2);
r2 = pow(x-(L+0.00625),2)+pow(y,2);
C_UDSI(c,t,0) = M/(4.0*PI*sqrt(pow(r1,3)))*sqrt(3.0*pow(y,2)/r1+1.0) + M/(4.0*PI*sqrt(pow(r2,3)))*sqrt(3.0*pow(y,2)/r2+1.0);
C_UDSI(c,t,1) = C_UDSI(c,t,0)*MUO;
C_UDSI(c,t,2) = pow(C_UDSI(c,t,0),2);
}
end_c_loop_all(c,t)
}
}

Many thanks in advance!!

Jin

https://www.dropbox.com/s/56u6z34pti...%20problem.jpg
zayafish is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
A problem about 'printf' and 'Message' in UDF. LICH Fluent UDF and Scheme Programming 2 May 2, 2013 03:45
Source Term used in Eulerian Model(Two phase) Padian FLUENT 1 May 19, 2008 04:47
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16
Multiphase flow problem icedou FLUENT 6 July 10, 2005 03:52
UDF variables F1, y / problem with UDF Fabian FLUENT 6 June 2, 2003 11:22


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