CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Need help! UDS equation is divergence in first iteration (http://www.cfd-online.com/Forums/fluent-udf/81737-need-help-uds-equation-divergence-first-iteration.html)

tompa November 5, 2010 02:06

Need help! UDS equation is divergence in first iteration
 
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 November 12, 2010 03:42

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 November 28, 2010 23:57

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?


All times are GMT -4. The time now is 00:12.