Natural log for UDF
Hi,
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*/ C_CENTROID(x,c,thread); F_PROFILE(c,thread,np) = k1*double log (double x1); } end_c_loop (c,thread) } |
I think the casting should be done with round paranthesis:
Code:
k1*(double)log((double)x1) |
Thanks a lot. it works!
|
All times are GMT -4. The time now is 12:58. |