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

Need help! UDS equation is divergence in first iteration

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 5, 2010, 02:06
Thumbs down Need help! UDS equation is divergence in first iteration
  #1
New Member
 
tom pan
Join Date: Nov 2010
Posts: 14
Rep Power: 16
tompa is on a distinguished road
I need to solve three more transport equation in the exist temperature field. But it's divergence in first iteration.
So i open solution controls---> advanced..., changing AMG method of uds equations from aggregative to selective and the verbosity is set to 2.

it don't shows divergence error this time but still have problem

uds-0 equation:
tol. 1.#QOe+000

Cycle Residual
----- ---------
0 1.#QOe+000
1 1.#QOe+000
2 1.#QOe+000
(omit)

What's the problem in the case that let tol. 1.#QOe+000 happen?
it seems like there exist a very small value in denominator in the iteration but i don't know how to fix it.

below are my udf file

#include "udf.h"
#define PI (3.1415926)

real x[ND_ND];
face_t f;
real diff;
real Kn, rc, kb, rp, diffuse;
real source, source1, B , As, dp, Tau, c, np, l, g;
real kk,e, lumda;


DEFINE_DIFFUSIVITY(diffusivity,c,t,i) //diffusivity coefficient of uds equation
{
C_CENTROID(x,c,t)
rp=3.*C_UDSI(c,t,1)/C_UDSI(c,t,2);
dp=2.*rp;
np=pow(C_UDSI(c,t,2),3)/(36*PI*C_UDSI(c,t,0)*pow(C_UDSI(c,t,1),2));
rc=rp*pow(np,(1./1.8));

lumda=C_MU_EFF(c,t)*sqrt(PI*28.8/(2*8.31*C_T(c,t)));
Kn=lumda/rp;
kb=1.38*pow(10.,-23);
diffuse=(kb*C_T(c,t)/(6.*PI*C_MU_EFF(c,t)*C_R(c,t)*rp))*((5.+4.*Kn+6.*p ow(Kn,2)+18.*pow(Kn,3))/(5.-Kn+(8.+PI)*pow(Kn,2)));
//what's the difference between turbulence viscousity C_MU_T(c,t) and Laminar viscousity C_MU_L(c,t) and effective viscousity C_MU_EFF(c,t)
return -diffuse;
}

DEFINE_SOURCE(N_source,c,t,dS,eqn)//source term of uds equation
{
C_CENTROID(x,c,t)
c=sqrt(8.*kb*C_UDSI(c,t,0)*C_T(c,t)/(PI*C_R(c,t)*C_UDSI(c,t,1)));
l=8.*diffuse/(PI*c);
g=(1./(6.*rc*l))*(pow((2.*rc+l),3.)-pow(4.*pow(rc,2.)+pow(l,2.),1.5))-2.*rc;
B=8.*PI*diffuse*dp*pow((dp/(dp+sqrt(2.)*g))+8.*diffuse/(sqrt(2.)*c*dp),-1.);

source=-0.5*pow(C_R(c,t),2.)*B*pow(C_UDSI(c,t,0),2.);
dS[eqn]=-pow(C_R(c,t),2.)*B*C_UDSI(c,t,0);
return source;
}

DEFINE_SOURCE(V_source,c,t,dS,eqn)
{
C_CENTROID(x,c,t)
return 0.;
}

DEFINE_SOURCE(A_source,c,t,dS,eqn)
{
C_CENTROID(x,c,t)
As=pow(PI*C_UDSI(c,t,0),1/3)*pow(6.*C_UDSI(c,t,1),2/3);
Tau=8.75*pow(10.,19)*pow(6.*C_UDSI(c,t,1)/C_UDSI(c,t,2),4)*exp(3.1*pow(10.,4.)/C_T(c,t));

source1=-(C_UDSI(c,t,2)-As)*C_R(c,t)/Tau;
dS[eqn]=-C_R(c,t)/Tau;
return source1;
}

DEFINE_PROFILE(S0,t,i)//boundary contion of uds
{
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
F_PROFILE(f,t,i)=3.22*pow(10.,24);
}
end_f_loop(f,t)

}

DEFINE_PROFILE(S1,t,i)
{
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
//F_PROFILE(f,t,i)=F_YI(f,t,5)*6.02*pow(10.,23.)*PI/(77.*4.);
F_PROFILE(f,t,i)=1.686;
}
end_f_loop(f,t)
}

DEFINE_PROFILE(S2,t,i)
{
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
F_PROFILE(f,t,i)=1.011*pow(10.,9);
}
end_f_loop(f,t)
}

Hope someone can solve my problem.
I have been disappointed for quite some time....
tompa is offline   Reply With Quote

Old   November 12, 2010, 03:42
Default
  #2
New Member
 
tom pan
Join Date: Nov 2010
Posts: 14
Rep Power: 16
tompa is on a distinguished road
i'm thinking that perhaps those 3 UDSs are too complicate to solve. If only in the region, like x=[0,10] , y=[-1,1], the UDSs need to be solved. How can i do this in UDF??
tompa is offline   Reply With Quote

Old   November 28, 2010, 23:57
Default
  #3
New Member
 
tom pan
Join Date: Nov 2010
Posts: 14
Rep Power: 16
tompa is on a distinguished road
It seem that if i choose a right initial value, the case will not diverge at the first step. But i haven't calculated a conclusion which is correct in my mind. Is it right that the initial values have a great influence on convergence?
tompa is offline   Reply With Quote

Reply

Tags
divergence, uds


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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56
Defining a UDS equation artin haroutunian FLUENT 0 October 16, 2009 05:52
divergence of equation student Main CFD Forum 2 January 30, 2009 22:32
UDS - Modification of the transport equation Jo FLUENT 0 April 3, 2007 12:46


All times are GMT -4. The time now is 11:19.