CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Natural log for UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 28, 2009, 04:34
Default Natural log for UDF
  #1
New Member
 
ehkhor
Join Date: Oct 2009
Posts: 3
Rep Power: 7
ehkhor is on a distinguished road
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)
}
ehkhor is offline   Reply With Quote

Old   October 28, 2009, 08:18
Default
  #2
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 647
Rep Power: 11
dmoroian is on a distinguished road
I think the casting should be done with round paranthesis:
Code:
k1*(double)log((double)x1)
dmoroian is offline   Reply With Quote

Old   October 28, 2009, 23:13
Default
  #3
New Member
 
ehkhor
Join Date: Oct 2009
Posts: 3
Rep Power: 7
ehkhor is on a distinguished road
Thanks a lot. it works!
ehkhor is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Log File too Large Julian K. OpenFOAM Running, Solving & CFD 12 June 12, 2015 00:44
natural logarithm function zhoubinwx OpenFOAM Programming & Development 8 July 5, 2010 06:13
Create new material: Natural gas Van FLUENT 0 August 18, 2005 04:55
Natural gas combustion Newbie Main CFD Forum 7 May 22, 2004 04:00
Natural gas combustion Newbie FLUENT 1 May 17, 2004 11:00


All times are GMT -4. The time now is 13:30.