CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   DEFINE_DIFFUSIVITY Error: Gauss_Elimination (https://www.cfd-online.com/Forums/fluent/40580-define_diffusivity-error-gauss_elimination.html)

wicwawa April 14, 2006 13:10

DEFINE_DIFFUSIVITY Error: Gauss_Elimination
 
Hi,here is part of my UDF codes for diffusity. I am using Fluent to simulate PEM fuel cell. But when i initialize it, error occur: Error: Gauss_Elimination: singular matrix

DEFINE_DIFFUSIVITY(diffusivity_f,c,t,i)

{ real diff,dhw,dow;

dow=0.5;

dhw=0.5;

if(i=0)

{

diff=(1-C_YI(c,t,0)/M_h2/(C_YI(c,t,2)/M_h2o+C_YI(c,t,0)/M_h2))/(C_YI(c,t,2)/M_h2o/(C_YI(c,t,2)/M_h2o+C_YI(c,t,0)/M_h2)/dhw);

}

else if(i=1)

{

diff=(1-C_YI(c,t,1)/M_o2/(C_YI(c,t,2)/M_h2o+C_YI(c,t,1)/M_o2))/(10/dow);

}

else

{

diff=(1-C_YI(c,t,2)/M_h2o/(C_YI(c,t,2)/M_h2o+C_YI(c,t,0)/M_h2+C_YI(c,t,1)/M_o2))/((C_YI(c,t,0)/M_h2/(C_YI(c,t,2)/M_h2o+C_YI(c,t,0)/M_h2+C_YI(c,t,1)/M_o2)/dhw)+(C_YI(c,t,1)/M_o2/(C_YI(c,t,2)/M_h2o+C_YI(c,t,0)/M_h2+C_YI(c,t,1)/M_o2)/dow));

}

return diff;

}

If i change the "diff = **** " to diff = a constant, then the error disappears. Would anybody help me? i am so confused.

Thx in advance

wicwawa April 15, 2006 10:52

Re: DEFINE_DIFFUSIVITY Error: Gauss_Elimination
 
problem solved. i originally declare dhw=0.09944*(pow(C_T(c,t),2.334))/C_P(c,t); dow=0.00544016*(pow(C_T(c,t),2.334))/C_P(c,t); As the operating pressure is 101325, the C_R(c,t) will return a Gauge Pressure,may be zero. Hence the problem. When i add (C_R(c,t)+101325), it will be ok.

Enjoy wicwawa


All times are GMT -4. The time now is 15:44.