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

Natural log for UDF

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

Reply
 
LinkBack Thread Tools Search this Thread 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: 16
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: 648
Rep Power: 20
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: 16
ehkhor is on a distinguished road
Thanks a lot. it works!
ehkhor is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 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


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