CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Natural log for UDF (

ehkhor October 28, 2009 04:34

Natural log for UDF

My model is J= k1*ln(x1) and the below is my codes. However, i received parse error in the line in pink font, which i could not detect any syntax error. please help.

#include "udf.h"

#define FLUID_ID 1
#define k1 2.00e-4
#define x1 1.3847
DEFINE_PROFILE(flux, thread, np)
cell_t c;
real x[ND_ND];

begin_c_loop (c,thread)
/* centroid is defined to specify position dependent profiles*/
F_PROFILE(c,thread,np) =
k1*double log (double x1);

end_c_loop (c,thread)

dmoroian October 28, 2009 08:18

I think the casting should be done with round paranthesis:


ehkhor October 28, 2009 23:13

Thanks a lot. it works!

All times are GMT -4. The time now is 01:24.