|
[Sponsors] |
October 28, 2009, 04:34 |
Natural log for UDF
|
#1 |
New Member
ehkhor
Join Date: Oct 2009
Posts: 3
Rep Power: 17 |
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) } |
|
October 28, 2009, 08:18 |
|
#2 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
I think the casting should be done with round paranthesis:
Code:
k1*(double)log((double)x1) |
|
October 28, 2009, 23:13 |
|
#3 |
New Member
ehkhor
Join Date: Oct 2009
Posts: 3
Rep Power: 17 |
Thanks a lot. it works!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Log File too Large | Julian K. | OpenFOAM Running, Solving & CFD | 17 | February 15, 2019 06:56 |
natural logarithm function | zhoubinwx | OpenFOAM Programming & Development | 8 | July 5, 2010 07:13 |
Create new material: Natural gas | Van | FLUENT | 0 | August 18, 2005 05:55 |
Natural gas combustion | Newbie | Main CFD Forum | 7 | May 22, 2004 05:00 |
Natural gas combustion | Newbie | FLUENT | 1 | May 17, 2004 12:00 |