|
[Sponsors] |
November 22, 2013, 16:31 |
Two-phase Eulerian UDF problem
|
#1 |
New Member
Jin Zhang
Join Date: May 2013
Posts: 1
Rep Power: 0 |
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |