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

DEFINE_DIFFUSIVITY Error: Gauss_Elimination

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wicwawa

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2006, 13:10
Default DEFINE_DIFFUSIVITY Error: Gauss_Elimination
  #1
wicwawa
Guest
 
Posts: n/a
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
Rui_27 likes this.
  Reply With Quote

Old   April 15, 2006, 10:52
Default Re: DEFINE_DIFFUSIVITY Error: Gauss_Elimination
  #2
wicwawa
Guest
 
Posts: n/a
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
  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



All times are GMT -4. The time now is 02:32.