|
[Sponsors] |
April 14, 2006, 13:10 |
DEFINE_DIFFUSIVITY Error: Gauss_Elimination
|
#1 |
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 |
|
April 15, 2006, 10:52 |
Re: DEFINE_DIFFUSIVITY Error: Gauss_Elimination
|
#2 |
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|