CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   HELP! how to use C_R_G(c,t,) correctly? (http://www.cfd-online.com/Forums/fluent/40592-help-how-use-c_r_g-c-t-correctly.html)

wicwawa April 15, 2006 12:09

HELP! how to use C_R_G(c,t,) correctly?
 
Hi, here is my UDF codes for a source. I am using Fluent to simulate PEM fuel cell.

I use the density gradient(y direction) to calculate the Net water transfer coefficient. But when i initialize it, error occur: access violation.

DEFINE_SOURCE(H2O_A,c,t,dS,eqn

{

real source7,nd;

nd=2.5*16.8/22;

source7=nd*5.5E-11*(C_YI_G(c,t,2)[1]*C_R(c,t)/M_h2o+C_R_G(c,t)[1]*C_YI(c,t,2)/M_h2o);

dS[eqn]=0;

return source7;

}

I also experiment simple source item using C_R_G(c,t)[1],but the same error appear.

When delete the C_R_G(c,t)[1], it will be ok.

Can everybody know what's wrong with my code. How to use C_R_G(c,t)?

THX in advance



All times are GMT -4. The time now is 14:45.