|
[Sponsors] |
April 23, 2017, 05:41 |
udf issue
|
#1 |
New Member
masoud
Join Date: Apr 2017
Posts: 1
Rep Power: 0 |
I am working with udf in ansys fluent . I need an udf for viscosity Changes with pH . Viscosity as a function of error function varies with pH(erf(pH)). I wrote an udf is as follows:
#include "udf.h" #include "mem.h" //#include "math.h" DEFINE_PROPERTY(cell_viscosity,c,t) { real c_mu_eff ; real mu_lam_0= 0.001 ; /* base viscosity (acid viscosity at pH=0 or 7)*/ real mu_lam_m= 200. ; /* maximum increment in the viscosity w.r.t*/ real C_ca; /* mass freaction of calcium*/ real pH; real C_max_ca= 10.; /* corresponding calcium ion where viscosity reaches the maximom value (wt)*/ real mw=36.5; /* molcolar whight of hcl*/ real w2=1.1, w3=2.; /* constant coefficiet*/ C_ca= C_YI(c,t,1)*100.; /* mass freaction of calcium ion*/ pH=-log10(C_YI(c,t,2)*C_R(c,t)/mw); c_mu_eff = mu_lam_0*(1.+mu_lam_m*exp(-(C_ca-C_max_ca)/w2)*(erf(PH-1)+1.)/w3); C_UDMI(c,t,4)= mu_lam_0*(1.+mu_lam_m*exp(-(C_ca-C_max_ca)/w2)*(erf(PH-1)+1.)/w3); return c_mu_eff; } But when I compile the code gives the error as follows: error: erf: undeclared variable Can anyone help me؟ |
|
April 24, 2017, 05:58 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Remove the two /'s before #include "math.h".
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
UDF for Wave Generation and UDF Compilation Error | Engrsdm | Fluent UDF and Scheme Programming | 0 | December 19, 2016 01:50 |
Help with unsteady calculation with source/sink UDF | RobV | FLUENT | 1 | November 13, 2016 06:44 |
UDF compilation/ platform issue! Help!! :s | lmarf88 | Fluent UDF and Scheme Programming | 4 | April 11, 2014 14:11 |
DEFINE_DPM_OUTPUT macro UDF HELP | Puneet | FLUENT | 3 | November 28, 2003 11:55 |