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

divergence + define_uds_flux + axisymmetric flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2014, 03:29
Default divergence + define_uds_flux + axisymmetric flow
  #1
New Member
 
Jacky
Join Date: Jul 2011
Posts: 24
Rep Power: 15
bharat.cmeri is on a distinguished road
Hi All,

I am defining one UDS eqn by having udf for its mass flux using DEFINE_UDS_FLUX(). Actual object of interest for uds application is a annular porous cylindrical region. So I have taken a section of object along its axis and have define made it as a rectangular domain...(pic of mesh is attached).
My UDF is given below....

DEFINE_UDS_FLUX(my_uds_flux,f,t,i)
{
cell_t c0, c1 = -1;
Thread *t0, *t1 = NULL;
real gamma, lambda_l, lambda_v, krl, krv, s;
real NV_VEC(psi_vec), NV_VEC(A), flux;

flux = 0.0;

c0 = F_C0(f,t);
t0 = F_C0_THREAD(f,t);
F_AREA(A, f, t);

/* If face lies at domain boundary, use face values; */
/* If face lies IN the domain, use average of adjacent cells. */

if (BOUNDARY_FACE_THREAD_P(t)) /*Most face values will be available*/
{
s = C_UDMI(c0,t0,1);
lambda_l = C_UDMI(c0,t0,4);
gamma = lambda_l*( 1.0 + (ROG*(1.0-s))/(ROL*s)) ;

NV_DS(psi_vec, =, F_U(f,t), F_V(f,t), 0.0, *, gamma);

flux = NV_DOT(psi_vec, A); /* flux through Face */
// Message("s, lambda_l, gamma, F_U(f,t), F_V(f,t), psi_vec[0], psi_vec[1], flux = %f %f %f %g %g %g %g %g \n", s, lambda_l, gamma, F_U(f,t), F_V(f,t), psi_vec[0], psi_vec[1], flux );
// Message("A[0], A[1] = %g %g \n", A[0], A[1] );

}
else
{
c1 = F_C1(f,t); /* Get cell on other side of face */
t1 = F_C1_THREAD(f,t);

s = 0.5*( C_UDMI(c0,t0,1) + C_UDMI(c1,t1,1) );
lambda_l = 0.5*( C_UDMI(c0,t0,4) + C_UDMI(c1,t1,4) );

gamma = lambda_l*( 1.0 + (ROG*(1.0-s))/(ROL*s)) ;

NV_DS(psi_vec, =, C_U(c0,t0),C_V(c0,t0),C_W(c0,t0),*,gamma);
NV_DS(psi_vec, +=, C_U(c1,t1),C_V(c1,t1),C_W(c1,t1),*,gamma);

flux = NV_DOT(psi_vec, A)/2.0; /* Average flux through face */
C_UDMI(c0,t0,11) = flux;
}

// Message(" FLUX, F_FLUX(f,t) = %g %g \n", flux, F_FLUX(f,t) );


return flux;
}

I have checked the value of flux going into fluent solver to be within a range of -3.63E-10 to 3.09E-14.


Now when ever I am using this in UDS-0 I am getting following error:

Error: Divergence detected in AMG solver: uds-0
Error Object: #f

To make sure what could be the reason I made verbosity in AMG panel to be 1 and got following reply:

iter continuity x-velocity y-velocity uds-0 time/iter

x-momentum equation:
tol. 1.0000e-20
0 3.1019e-25
1 1.3428e-30

y-momentum equation:
tol. 8.8308e-19
0 1.7662e-06
1 1.5347e-11

pressure correction equation:
tol. 6.6436e-17
0 1.3287e-04
1 1.9282e-03
2 2.2744e-03
3 1.3370e-03
4 1.0036e-03
5 7.2081e-04
6 3.1648e-04
7 2.1811e-04

uds-0 equation:
tol. 3.1881e-08
0 4.2003e+00
1 1.#QNBe+00


That means uds-0 residuals are becoming NAN but I dont know how to correct it.

I am using flexible cycle for uds-0 with no stabilization.
Pressure discretization = standard
Momentum " " = second order upwind
UDS-0 " " = power law.


Under Relaxation Factor for uds-0 is 0.1.


SO can anybody point out what could be the reason for this error and how to correct it ?????

Awaiting some reply,

Bharat
Attached Images
File Type: jpg cfd-online-mesh-axisymmetric.jpg (17.5 KB, 22 views)

Last edited by bharat.cmeri; September 5, 2014 at 03:44. Reason: attachment added
bharat.cmeri is offline   Reply With Quote

Reply


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
Divergence problem Smaras FLUENT 13 February 21, 2013 06:03
2D axisymmetric mass flow rate for the plain orifice atomizer jwillie2000 FLUENT 2 September 17, 2010 06:43
Divergence problems with interface in 2D transonic external flow drrbradford FLUENT 1 June 23, 2010 12:09
2d- axisymmetric pipe flow sara Main CFD Forum 0 October 14, 2008 16:54
Convergence for axisymmetric flow bl201 Main CFD Forum 5 August 16, 2005 18:01


All times are GMT -4. The time now is 13:52.